Skip to content

Suggestion to warn against nested QueryClientProviders #2670

Answered by TkDodo
alvarlagerlof asked this question in Ideas
Discussion options

You must be logged in to vote

Not sure how this would technically be possible. It’s just react context under the hood, and nesting context providers is valid. Using a context just looks up the nearest provider.

One use case would be to set different default options for a subtree as described here: https://tkdodo.eu/blog/testing-react-query#reactqueryconfigprovider

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@alvarlagerlof
Comment options

Answer selected by alvarlagerlof
Comment options

You must be logged in to vote
1 reply
@TkDodo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants