Sponsor of the Day:
Jerkmate
https://tanstack.com/query/latest/docs/framework/react/examples/suspense
React TanStack Query Suspense Example | TanStack Query Docs
An example showing how to implement Suspense in React using TanStack Query.
react tanstack queryexample docssuspense
https://tanstack.com/query/latest/docs/framework/react/examples/nextjs-app-prefetching
React TanStack Query Nextjs App Prefetching Example | TanStack Query Docs
An example showing how to implement Nextjs App Prefetching in React using TanStack Query.
react tanstack querynextjs appexample docsprefetching
https://tanstack.com/query/latest/docs/framework/react/examples/star-wars
React TanStack Query Star Wars Example | TanStack Query Docs
An example showing how to implement Star Wars in React using TanStack Query.
react tanstack querystar warsexample docs
https://tanstack.com/query/latest/docs/framework/react/examples/react-router
React TanStack Query React Router Example | TanStack Query Docs
An example showing how to implement React Router in React using TanStack Query.
react tanstack queryexample docsrouter
https://tanstack.com/query/latest/docs/framework/react/examples/shadow-dom
React TanStack Query Shadow Dom Example | TanStack Query Docs
An example showing how to implement Shadow Dom in React using TanStack Query.
react tanstack queryshadow domexample docs
https://tanstack.com/query/latest/docs/framework/react/examples/rick-morty
React TanStack Query Rick Morty Example | TanStack Query Docs
An example showing how to implement Rick Morty in React using TanStack Query.
react tanstack queryrick mortyexample docs
https://tanstack.com/query/latest/docs/framework/react/examples/chat
React TanStack Query Chat Example | TanStack Query Docs
An example showing how to implement Chat in React using TanStack Query.
react tanstack queryexample docschat
https://tanstack.com/query/latest/docs/framework/react/examples/algolia
React TanStack Query Algolia Example | TanStack Query Docs
An example showing how to implement Algolia in React using TanStack Query.
react tanstack queryexample docsalgolia
https://tanstack.com/query/latest/docs/framework/react/examples/nextjs
React TanStack Query Nextjs Example | TanStack Query Docs
An example showing how to implement Nextjs in React using TanStack Query.
react tanstack queryexample docsnextjs
https://tanstack.com/query/latest/docs/framework/react/examples/offline
React TanStack Query Offline Example | TanStack Query Docs
An example showing how to implement Offline in React using TanStack Query.
react tanstack queryexample docsoffline
https://tanstack.com/query/latest/docs/framework/react/examples/basic-graphql-request
React TanStack Query Basic Graphql Request Example | TanStack Query Docs
An example showing how to implement Basic Graphql Request in React using TanStack Query.
react tanstack querygraphql requestexample docsbasic
https://tanstack.com/query/latest/docs/framework/react/examples/react-native
React TanStack Query React Native Example | TanStack Query Docs
An example showing how to implement React Native in React using TanStack Query.
react tanstack queryexample docsnative
https://tanstack.com/query/latest/docs/framework/react/examples/optimistic-updates-cache
React TanStack Query Optimistic Updates Cache Example | TanStack Query Docs
An example showing how to implement Optimistic Updates Cache in React using TanStack Query.
react tanstack queryoptimistic updatesexample docscache
https://tanstack.com/query/latest/docs/framework/react/examples/auto-refetching
React TanStack Query Auto Refetching Example | TanStack Query Docs
An example showing how to implement Auto Refetching in React using TanStack Query.
react tanstack queryexample docsauto
https://tanstack.com/query/latest/docs/framework/react/examples/nextjs-suspense-streaming
React TanStack Query Nextjs Suspense Streaming Example | TanStack Query Docs
An example showing how to implement Nextjs Suspense Streaming in React using TanStack Query.
react tanstack queryexample docsnextjssuspensestreaming
https://tanstack.com/query/latest/docs/framework/react/examples/optimistic-updates-ui
React TanStack Query Optimistic Updates Ui Example | TanStack Query Docs
An example showing how to implement Optimistic Updates Ui in React using TanStack Query.
react tanstack queryoptimistic updatesexample docsui
https://tanstack.com/query/latest/docs/framework/react/examples/basic
React TanStack Query Basic Example | TanStack Query Docs
An example showing how to implement Basic in React using TanStack Query.
react tanstack querybasic exampledocs
https://tanstack.com/query/latest/docs/framework/react/guides/mutations
Mutations | TanStack Query React Docs
Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. For this purpose, TanStack Query exports a...
tanstack query reactmutationsdocs
https://tanstack.com/query/latest/docs/framework/react/reference/useIsFetching
useIsFetching | TanStack Query React Docs
useIsFetching is an optional hook that returns the number of the queries that your application is loading or fetching in the background (useful for app-wide...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/does-this-replace-client-state
Does TanStack Query replace Redux, MobX or other global state managers? | TanStack Query React Docs
Well, let's start with a few important items: TanStack Query is a server-state library, responsible for managing asynchronous operations between your server...
tanstack queryglobal statereact docsreplaceredux
https://tanstack.com/query/latest/docs/framework/react/guides/queries
Queries | TanStack Query React Docs
Query Basics A query is a declarative dependency on an asynchronous source of data that is tied to a unique key. A query can be used with any Promise based...
queries tanstack queryreact docs
https://tanstack.com/query/latest/docs/framework/react/guides/query-invalidation
Query Invalidation | TanStack Query React Docs
Waiting for queries to become stale before they are fetched again doesn't always work, especially when you know for a fact that a query's data is out of date...
tanstack react docsqueryinvalidation
https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient
persistQueryClient | TanStack Query React Docs
This is set of utilities for interacting with
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/invalidations-from-mutations
Invalidations from Mutations | TanStack Query React Docs
Invalidating queries is only half the battle. Knowing when to invalidate them is the other half. Usually when a mutation in your app succeeds, it's VERY likely...
tanstack query reactmutationsdocs
https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-react-query-4
Migrating to React Query 4 | TanStack Query React Docs
Breaking Changes v4 is a major version, so there are some breaking changes to be aware of: react-query is now @tanstack/react-query You will need to...
react querytanstack docsmigrating4
https://tanstack.com/query/latest/docs/framework/react/reference/useMutationState
useMutationState | TanStack Query React Docs
useMutationState is a hook that gives you access to all mutations in the MutationCache. You can pass filters to it to narrow down your mutations, and select to...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/suspense
Suspense | TanStack Query React Docs
React Query can also be used with React's Suspense for Data Fetching APIs. For this, we have dedicated hooks: Additionally, you can use the useQuery().promise...
tanstack query reactsuspensedocs
https://tanstack.com/query/latest/docs/framework/react/reference/hydration
hydration | TanStack Query React Docs
dehydrate dehydrate creates a frozen representation of a cache that can later be hydrated with HydrationBoundary or hydrate. This is useful for passing...
tanstack query reacthydrationdocs
https://tanstack.com/query/latest/docs/framework/react/reference/useIsMutating
useIsMutating | TanStack Query React Docs
useIsMutating is an optional hook that returns the number of mutations that your application is fetching (useful for app-wide loading indicators). tsx import {...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/query-options
Query Options | TanStack Query React Docs
One of the best ways to share queryKey and queryFn between multiple places, yet keep them co-located to one another, is to use the queryOptions helper. At...
tanstack react docsqueryoptions
https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults
Important Defaults | TanStack Query React Docs
Out of the box, TanStack Query is configured with aggressive but sane defaults. Sometimes these defaults can catch new users off guard or make...
tanstack query reactimportantdefaultsdocs
https://tanstack.com/query/latest/docs/eslint/no-unstable-deps
Disallow putting the result of query hooks directly in a React hook dependency array | TanStack...
The object returned from the following query hooks is not referentially stable: useQuery useSuspenseQuery useQueries useSuspenseQueries useInfiniteQuery...
react hookdisallowputtingresultquery
https://tanstack.com/query/latest/docs/framework/react/guides/parallel-queries
Parallel Queries | TanStack Query React Docs
queries tanstack queryreact docsparallel
https://tanstack.com/query/latest/docs/framework/react/guides/optimistic-updates
Optimistic Updates | TanStack Query React Docs
React Query provides two ways to optimistically update your UI before a mutation has completed. You can either use the onMutate option to update your cache...
tanstack query reactoptimistic updatesdocs
https://tanstack.com/query/latest/docs/framework/react/reference/usePrefetchQuery
usePrefetchQuery | TanStack Query React Docs
tsx usePrefetchQuery(options) Options You can pass everything to usePrefetchQuery that you can pass to . Remember that some of them are required as below:...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/paginated-queries
Paginated / Lagged Queries | TanStack Query React Docs
Rendering paginated data is a very common UI pattern and in TanStack Query, it
queries tanstack queryreact docspaginatedlagged
https://tanstack.com/query/latest/docs/framework/react/guides/testing
Testing | TanStack Query React Docs
React Query works by means of hooks either the ones we offer or custom ones that wrap around them. With React 17 or earlier, writing unit tests for these...
tanstack query reacttestingdocs
https://tanstack.com/query/latest/docs/framework/react/graphql
GraphQL | TanStack Query React Docs
Because React Query's fetching mechanisms are agnostically built on Promises, you can use React Query with literally any asynchronous data fetching client,...
tanstack query reactgraphqldocs
https://tanstack.com/query/latest/docs/framework/react/quick-start
Quick Start | TanStack Query React Docs
This code snippet very briefly illustrates the 3 core concepts of React Query:
tanstack query reactquick startdocs
https://tanstack.com/query/latest/docs/framework/react/plugins/createSyncStoragePersister
createSyncStoragePersister | TanStack Query React Docs
Deprecated This plugin is deprecated and will be removed in the next major version. You can simply use instead. Installation This utility comes as a separate...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/filters
Filters | TanStack Query React Docs
Some methods within TanStack Query accept a QueryFilters or MutationFilters object. Query Filters A query filter is an object with certain conditions to match...
tanstack query reactfiltersdocs
https://tanstack.com/query/latest/docs/framework/react/guides/query-retries
Query Retries | TanStack Query React Docs
When a useQuery query fails (the query function throws an error), TanStack Query will automatically retry the query if that query's request has not reached the...
tanstack react docsqueryretries
https://tanstack.com/query/latest/docs/framework/react/reference/QueryErrorResetBoundary
QueryErrorResetBoundary | TanStack Query React Docs
When using suspense or throwOnError in your queries, you need a way to let queries know that you want to try again when re-rendering after some error occurred....
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions
queryOptions | TanStack Query React Docs
tsx queryOptions({ queryKey, ...options, }) Options You can generally pass everything to queryOptions that you can also pass to . Some options will have no...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/reference/usePrefetchInfiniteQuery
usePrefetchInfiniteQuery | TanStack Query React Docs
tsx usePrefetchInfiniteQuery(options) Options You can pass everything to usePrefetchInfiniteQuery that you can pass to . Remember that some of them are...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/reference/useSuspenseQuery
useSuspenseQuery | TanStack Query React Docs
tsx const result = useSuspenseQuery(options) Options The same as for , except for: throwOnError enabled placeholderData Returns Same object as , except that:...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr
Advanced Server Rendering | TanStack Query React Docs
Welcome to the Advanced Server Rendering guide, where you will learn all about using React Query with streaming, Server Components and the Next.js app router....
tanstack query reactadvanced serverrenderingdocs
https://tanstack.com/query/latest/docs/framework/react/guides/background-fetching-indicators
Background Fetching Indicators | TanStack Query React Docs
A query's status === 'pending' state is sufficient enough to show the initial hard-loading state for a query, but sometimes you may want to display an...
tanstack query reactbackgroundfetchingindicatorsdocs
https://tanstack.com/query/latest/docs/framework/react/reference/mutationOptions
mutationOptions | TanStack Query React Docs
tsx mutationOptions({ mutationFn, ...options, }) Options You can generally pass everything to mutationOptions that you can also pass to .
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/reference/useQueryClient
useQueryClient | TanStack Query React Docs
The useQueryClient hook returns the current QueryClient instance. tsx import { useQueryClient } from '@tanstack/react-query' const queryClient =...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/reference/useQuery
useQuery | TanStack Query React Docs
tsx const { data, dataUpdatedAt, error, errorUpdatedAt, failureCount, failureReason, fetchStatus, isError, isFetched, isFetchedAfterMount, isFetching,...
tanstack query reactdocs
https://tanstack.com/query/latest/docs/framework/react/comparison
Comparison | React Query vs SWR vs Apollo vs RTK Query vs React Router | TanStack Query React Docs
This comparison table strives to be as accurate and as unbiased as possible. If you use any of these libraries and feel the information could be improved, feel...
react querytanstack docscomparisonvsswr
https://tanstack.com/query/latest/docs/framework/react/guides/ssr
Server Rendering & Hydration | TanStack Query React Docs
In this guide you'll learn how to use React Query with server rendering. See the guide on for some background. You might also want to check out the before...
tanstack query reactserver renderinghydrationdocs