#Creating NPM Package That Uses react-query

4 messages · Page 1 of 1 (latest)

quick sedge
#

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.

chrome sky
#

If the exported function is called from a component that is a descendant of QueryClientProvider, that should work, yes.

quick sedge
#

Got it, thank you.

desert owl
#

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