Creating NPM Package That Uses react-query
Hello. I have a question about building an NPM package that uses react-query. If my package exports a function that wraps a call to
useQuery
will that query have access to the application's QueryClientProvider
? In this case the application would call the exported function.4 Replies
other-emerald•3y ago
If the exported function is called from a component that is a descendant of
QueryClientProvider
, that should work, yes.optimistic-goldOP•3y ago
Got it, thank you.
absent-sapphire•5mo ago
I'm trying this and it works when in the pnpm workspace, but not after the build with vite. Then I get an error about missing client provider
rising-crimson•5mo ago
then you have likely bundled two versions of react-query