- Lucas' Newsletter
- Posts
- No QueryClient set, use QueryClientProvider to set one [Fix]
No QueryClient set, use QueryClientProvider to set one [Fix]
![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/59645c03-ce21-4406-bb2b-4ca1b5e613f6/photo-1633356122544-f134324a6cee.jpeg?t=1722263288)
Photo by Lautaro Andreani / Unsplash
So I am a big dumb dumb. I have a couple of projects all using react-query, and some using @tanstack/react-query.On one of those I encountered those errors, and here's the code.
And here's where I'm using the useQuery.
Notice the error?
It's basically because on one side I'm importing as
While the other is:
If your project uses one or the other, pick one and use it, don't mix two imports. If you're working with the newest version, just import everything from @tanstack/react-query.
That is it.
Like what you see? Check out my projects and my youtube channel, or give me a thanks on Twitter.