State Management · Senior · Question 48 of 75
What's the main risk of copying server data from useQuery into a Zustand/Redux store?
- ✓Correct answer: Two sources of truth: the copy goes stale and needs manual syncing
- 2TanStack Query deletes data copied elsewhere
- 3Stores can't hold arrays returned by queries
Explanation
Read server data from the query cache wherever needed (the same hook in many components is deduplicated). Store only client decisions (selected id, filters) and derive the rest.