New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: WRAPPER_REACT_QUERY.md #642
fix: WRAPPER_REACT_QUERY.md #642
Conversation
|
||
const App = () => { | ||
return ( | ||
<PersistQueryClientProvider persistOptions={{ persister: clientPersister }}> | ||
<QueryClientProvider client={queryClient}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where's that import coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QueryClientProvider
is imported from "@tanstack/react-query".
I didn't add it since it's required even for basic usage as well.
@mrousavy should I add this to the top?
import { QueryClientProvider } from "@tanstack/react-query";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please add that - then we can merge :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
awesome thanks! |
@AlirezaHadjar Can you clarify why you replaced here the |
@fobos531 in the case of no persister or any async persister the method you menthioned is recommended but as for sync persister, I could only find this method https://tanstack.com/query/latest/docs/framework/react/plugins/createSyncStoragePersister |
You can find it here, with the example for the sync persister: https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient#persistqueryclientprovider IMO this approach might be more preferable compared to the method mentioned in this PR. What do you think? |
As I checked both doc pages, I couldn't find any advantages of one to the other. Could you please elaborate on what do you mean by "preferable"? |
Primarily due to reasons listed in the screenshot below: To be honest, I've never experienced issues described in that screenshot, but it convinced me to use that approach regardless. |
Correct! |
Sure: #658 |
This PR updates the integration of the react query with mmkv. I have also updates doc links