State Management · Junior · Question 41 of 75
What's needed before calling useQuery in an app?
- ✓Correct answer: Create a
QueryClientand wrap the app inQueryClientProvider - 2Nothing: the cache is created automatically on the first call
- 3A Redux store where TanStack Query keeps its cache
Explanation
The QueryClient holds the cache and defaults. Create it once (outside the component or in useState) so the cache isn't reset on every render. Redux isn't required.