thirdweb-dev / js

Best in class web3 SDKs for Browser, Node and Mobile apps
https://thirdweb.com
Apache License 2.0
466 stars 390 forks source link

Error using React Query #2709

Closed alireza-sharifpour closed 7 months ago

alireza-sharifpour commented 7 months ago

I'm encountering an issue with Thirdweb while using React Query.

I use both Thirdweb and React Query in my app. Thirdweb works fine without React Query, but when I add React Query, I get this error:

Error: No QueryClient set, use QueryClientProvider to set one.

And when I pass QueryClient to ThirdwebProvider, I get another error:

Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutationCache, logger, defaultOptions, and 4 more.

I use React Query v5.29.0, and I checked that Thirdweb uses the same. My Thirdweb versions are:

"@thirdweb-dev/react": "^4.4.33", "@thirdweb-dev/sdk": "^4.0.59".

Do you know what the problem is?

jnsdls commented 7 months ago

@alireza-sharifpour the version of @tanstack/react-query in use in @thirdweb-dev/react is still version 4 - purely based on what you're describing here I assume the version of @tanstack/react-query you are using in your project is version 5.

If my guess is correct these are your options: