Reactjs Fetch data the right way

Reactjs Fetch data the right way

Post Date : 2023-10-01T18:38:44+07:00

Modified Date : 2023-10-01T18:38:44+07:00

Category: reactjs

Tags: reactjs

There are several ways to manage your api calls in ReactJS Application. The main purposes are:

  • Fetching
  • Caching
  • Synchronizing and updating server state

In the scope of this article, I will introduce with you several ways to do that

  • Use Axios as http call library and create your own service to manage api calls
  • Use RTK Query
  • Use Tanstack Query
  • Use SWR
  • Apolo Client (for GraphQL)
  • URQL(for GraphQL)

Use Axios and create your own service to manage api calls