State Management · Senior · Question 37 of 75

How does SWR avoid re-rendering a component when unrelated fields of the response change?

Explanation

If a component uses only data, changes to isValidating don't re-render it. SWR also deep-compares data by default (compare option), so an identical refetch doesn't trigger an update.

Further reading

Problem with a question

State Management · Senior · question 37

Test yourself

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

Take this quiz