Skip to content

QuizNot attempted

Server state vs client state

Which belongs in a server-state cache (React Query / SWR / RTK Query) rather than in a client store?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • The list of products fetched from the API
  • The product list is a cache of data the server owns, so it needs deduping, staleness, background refetch, retries and invalidation, which is exactly what React Query / SWR / RTK Query provide.
  • Not filters panel open, form draft, or theme: all three are owned by the client, never fetched, and belong in local state or a small client store.