React · Senior · Question 35 of 75

What is structural sharing in TanStack Query?

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.

Further reading

Problem with a question

React · Senior · question 35

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz