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
ambitious-aqua•3y ago
If the exported function is called from a component that is a descendant of
QueryClientProvider, that should work, yes.rising-crimsonOP•3y ago
Got it, thank you.
stormy-gold•7mo 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
causal-orange•7mo ago
then you have likely bundled two versions of react-query