Loading tutorials
useState and useEffect, and that you know basic HTTP, fetch, status codes, and JSON APIs.2 min readfetch and HTTP status codes. You should also have installed @tanstack/react-query (version 5) in a React and TypeScript project.2 min readfetch. It also assumes you have already placed a QueryClientProvider at the top of your app, as shown in the previous chapter.2 min readuseQuery call and know that fetch returns a Promise. Here you will learn how to render each phase of a request and avoid the most common mistakes.2 min readuseQuery and know that a query function returns a Promise. It covers how to build query keys that identify data correctly.2 min readuseQuery call, know what a query key is, and have a QueryClientProvider set up. Here you will learn how TanStack Query decides whether to serve cached data, refetch it, or throw it away.2 min readuseQuery call and know how staleTime decides whether cached data is fresh or stale. Here you will see what makes a query fetch again without any code of yours, and what happens when a fetch fails.2 min readuseQuery calls, understand query keys, and know how to send POST, PATCH, and DELETE requests with fetch. Queries read data. Mutations create, update, or delete it.2 min readuseQuery call, know how query keys identify cache entries, and understand the difference between fresh and stale data. It also assumes you have seen useMutation. Here you connect a mutation to the cache so the screen updates after the server changes.2 min readuseQuery call and that you understand query keys and query status. Some queries can't run until something else exists. Examples are a user id that comes from another request, or a search term the user hasn't typed yet. The enabled option handles these c2 min readuseMutation, query keys, and invalidation from the earlier chapters. You should also be comfortable with TypeScript and async/await.2 min readuseQuery, query keys, and staleTime from earlier chapters. It also assumes basic React state with useState.2 min readuseQuery, you understand query keys and staleTime, and you have seen the paginated-list chapter. Infinite queries build on both.2 min readstaleTime, and gcTime, and that you can use useQuery and QueryClientProvider. Prefetching builds on the cache rules from the earlier chapters.2 min readQueryClientProvider, write useQuery calls with query keys, and explain staleTime and gcTime. The Devtools let you see those ideas working in a running app. They show every query in the cache, its status, and when it will refetch.2 min readuseQuery and QueryClientProvider from earlier chapters. The examples use Vitest.2 min readuseQuery, query keys, staleTime) and basic React server rendering. The examples use the Next.js App Router, but the idea applies to any framework that renders React on the server.2 min read