This example shows how you can use Tanstack (react-query) for asynchronous state management in React.
- npm install
- npm run dev
JSON-server http://localhost:3000/
Frontend http://localhost:5173/
You can see:
- Tanstack pagination implementation (with split on pages and next/prev buttons)
- Tanstack infinite pagination (Dynamically loading data)
- Tanstack example TodoList with remove/toggle/create ToDo item
db.json - database
Use slow network mode. Go to Network in your browser and select Slow 4G to better understand what is done here
- queryOptions and infiniteQueryOptions implementation
- jsonApiInstance implementation
- Pissimistic and optimistics update (remove and update data)
- Use react-query cache
- Use useSuspenseQuery, useMutation, useQuery,
- Implemented ErrorBoundary
- Use prefetchQuery
- Implemented example without anti-pattern (useEffects)