React · Junior · Question 50 of 75

What must you do before using useQuery in an app?

Explanation

QueryClient holds the cache and default settings, and the provider makes it available to hooks. Create the client once (outside a component or via useState), otherwise the cache resets on every render. TanStack Query doesn't need Redux.

Further reading

Problem with a question

React · Junior · question 50

Test yourself

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

Take this quiz