Configure staleTime within React Query

InstructorTomasz Ducin

Share this video with your friends

Send Tweet

In queryOptions you can set the staleTime of a query to set how long it takes for data to be considered stale and warrant a refetch.

By default, React Query sets this value to 0.

But, different queries will need different times set depending on how often the data on the server is being updated.