Replies: 1 comment 11 replies
-
How is "the library" referencing react-query? Does it have it as a |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use a single Wrapper Component in a library im providing. The wrapper should provide stuff like Context and QueryClient. The component looks like this:
When wrapping children with the
Wrapper
useQuery throws an error that no QueryClientProvider is set. In this caseApp
uses the useQuery Hook from react-query.App component:
main.tsx
At first i thought you need a QueryClientProvider directly above an useQuery hook. But for example in Storybook you can define one QueryClient for all stories together.
Vite has an open issue for this vitejs/vite#3753 but in this SO post (https://stackoverflow.com/questions/71020363/using-queryclientprovider-in-a-wrapper) it seemed to be machine related?
Beta Was this translation helpful? Give feedback.
All reactions