Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

No QueryClient set, use QueryClientProvider to set one at useQueryClien Error in using reactQueryProvider

I am using react-router@6 and react-query@5.
I take this error message when I want log the States data: No QueryClient set, use QueryClientProvider to set one at useQueryClient.how can I that fix. please guid me.
enter image description here

this is my code:
enter image description here
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You could not have useStates on the same layer you returned <QueryClientProvider/>

Try removing the layer and rewrap the contents like so

App.tsx

...
    return (
         <>
         <ReactQueryDevTools ... />
         <RouteProvider ... />
         </>
    )

Root.tsx

...
   return (
        <QueryClientProvider>
        <App />
        </QueryClientProvider>
    )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading