Replies: 1 comment
-
this is not easily possible without creating a "global variable" somewhere as a side effect
this will be possible with v5: see the point under It does mean that for now, you can create a custom react context and pass that in everywhere instead of wrapping in a |
Beta Was this translation helpful? Give feedback.
0 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.
-
When using frameworks such as umi we do not get a chance to create the
App()
object as shown in theQueryClientProvider
examples. (The page components are directly loaded in the layout by the framework, making it difficult to create a provider at the root level).Besides many examples just show the creation as
const queryClient = new QueryClient()
and nothing fancy.It would greatly improve the Dev experience if you could make this as optional.
useQuery
does not find an activequeryClient
could you please just create one internally and use it across instead of throwing error forcing the users to create a wrapper DOM node at the root level?Or atleast
queryClient
instance (apart from the JSX root level wrapper<QueryClientProvider>
).Currently there is no way to supply a
queryClient
instance directly in the code/API apart from wrapping it through JSX wrappers, which is very inconvenient in some scenarios.Beta Was this translation helpful? Give feedback.
All reactions