State Management · Middle · Question 42 of 75

Why do two components with the same SWR key make only one request?

Explanation

Within the deduping interval (2 seconds by default) concurrent requests for one key are merged, and both components share the cached data. That lets you call useUser() in many components freely.

Further reading

Problem with a question

State Management · Middle · question 42

Test yourself

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

Take this quiz