React · Senior · Question 35 of 75
What is structural sharing in TanStack Query?
- ✓Correct answer: Unchanged parts of a response keep their previous references after a refetch
- 2One cache is shared between several browser tabs
- 3Responses from different queries are stored in one shared normalized table
Explanation
When updating data, the library deeply compares the new JSON with the old and reuses references to matching objects. So components that depend on unchanged parts don't re-render, and memo and effect dependencies work correctly.