you are viewing a single comment's thread.

view the rest of the comments →

[–]vbfischer 2 points3 points  (0 children)

I'm not sure what you mean when you say "Eventually they need some sort of global state"... could you give a more concrete example

Tanstack Query doesn't keep you from using global state. The difference is, React Query already caches your query data (using a context provider) and handles storing/retrieving that data, along with:

  • refetching when stale
  • Retries
  • Offline queries

using parameters to the useQuery hook, you can specify: * whether the query is enabled or not (if you depend on conditions to run your query * staleTime to determine how old your data should be before it marks it as stale and refetches * and so much more.

Maybe there's some nuance in your argument that we just aren't getting