State Management · Senior · Question 25 of 75

Why must you not create one global QueryClient for all requests on the server?

Explanation

Server processes handle many users. Create the client per request (e.g. React cache() in RSC). In the browser, by contrast, one client for the whole app is correct.

Further reading

Problem with a question

State Management · Senior · question 25

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