Skip to content

An example of a simple react-query to control crud operations. Using: react-query(useQuery, useMutation) hooks, bootstrap, react-router-dom, mockApi etc.

Notifications You must be signed in to change notification settings

UlfetZakirli/React-Query-CRUD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$\color{brown}{React-Query}$

  • React Query is a ReactJS preconfigured data management library which gives you power and control over server-side state management, fetching, and caching of data, and error handling in a simple and declarative way without affecting the global state of your application.

  • Server data is asynchronous – it can easily be outdated, this is because the data is not stored in your React application. This is where the Query library shines, to allow you to manipulate the asynchronous data, cache it, and also, update stale data or synchronize it.

$\color{brown}{Is}$ $\color{brown}{React-Query}$ $\color{brown}{good}$ $\color{brown}{enough?}$

  • React Query is a big thing because it helps with server-state data management. This means that you no longer have to worry about keeping everything in a standard global state because most libraries were created to handle client state only and the server states are way different. React Query is good enough because this library will help you to fetch, synchronize, update, and cache your remote data while also reducing the amount of code you need to write by providing you two simple hooks and one utility function. With React Query, you do not need to write boilerplate codes to enable it to post with React as is the case with the other libraries.

Benefits of using React Query in your React application:

  • Ease of data fetching;
  • It is becoming the standard way to fetch data;
  • Highly customizable;
  • Lightweight;
  • deduping multiple requests for the same data into a single request;
  • updating “out of date” data in the background (on windows focus, reconnect, interval, and so on);
  • memoizing query results;
  • mutations, which make it easy to implement optimistic changes.
  • prefetching the data;
  • performance optimizations like pagination and lazy loading data;

Folder Structure:

image

About

An example of a simple react-query to control crud operations. Using: react-query(useQuery, useMutation) hooks, bootstrap, react-router-dom, mockApi etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published