From 858bb127751c3c28536ecad28d34126b3fdfa4c7 Mon Sep 17 00:00:00 2001 From: Alireza Hadjar <57192409+AlirezaHadjar@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:38:29 +0330 Subject: [PATCH 1/3] Update WRAPPER_REACT_QUERY.md --- docs/WRAPPER_REACT_QUERY.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/WRAPPER_REACT_QUERY.md b/docs/WRAPPER_REACT_QUERY.md index 8b19169e..3536b68a 100644 --- a/docs/WRAPPER_REACT_QUERY.md +++ b/docs/WRAPPER_REACT_QUERY.md @@ -1,6 +1,6 @@ # react-query wrapper -If you want to use MMKV with [react-query](https://tanstack.com/query/v4/docs/plugins/persistQueryClient), follow further steps: +If you want to use MMKV with [react-query](https://tanstack.com/query/latest/docs/framework/react/overview), follow further steps: 1. Install `react-query` persist packages @@ -35,15 +35,20 @@ export const clientPersister = createSyncStoragePersister({ storage: clientStora 3. Use created `clientPersister` in your root component (eg. `App.tsx`) ```ts -import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client' +import { persistQueryClient } from "@tanstack/react-query-persist-client"; + +persistQueryClient({ + queryClient, + persisted: clientPersister, +}); const App = () => { return ( - + {...} - + ); }; ``` -For more information check their official [docs](https://tanstack.com/query/v4/docs/plugins/persistQueryClient#persistqueryclientprovider) +For more information check their official [docs](https://tanstack.com/query/latest/docs/framework/react/plugins/createSyncStoragePersister) From 8ce1fc593b1bff0ff7f41708580b82e8b1ca2692 Mon Sep 17 00:00:00 2001 From: Alireza Hadjar <57192409+AlirezaHadjar@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:42:05 +0330 Subject: [PATCH 2/3] Fix typo in doc --- docs/WRAPPER_REACT_QUERY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/WRAPPER_REACT_QUERY.md b/docs/WRAPPER_REACT_QUERY.md index 3536b68a..e962414d 100644 --- a/docs/WRAPPER_REACT_QUERY.md +++ b/docs/WRAPPER_REACT_QUERY.md @@ -39,7 +39,7 @@ import { persistQueryClient } from "@tanstack/react-query-persist-client"; persistQueryClient({ queryClient, - persisted: clientPersister, + persister: clientPersister, }); const App = () => { From 7290ed59a8badc099e150e58abd08be82134685b Mon Sep 17 00:00:00 2001 From: Alireza Hadjar <57192409+AlirezaHadjar@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:38:22 +0330 Subject: [PATCH 3/3] Added `QueryClientProvider` import doc --- docs/WRAPPER_REACT_QUERY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/WRAPPER_REACT_QUERY.md b/docs/WRAPPER_REACT_QUERY.md index e962414d..349106a7 100644 --- a/docs/WRAPPER_REACT_QUERY.md +++ b/docs/WRAPPER_REACT_QUERY.md @@ -35,6 +35,7 @@ export const clientPersister = createSyncStoragePersister({ storage: clientStora 3. Use created `clientPersister` in your root component (eg. `App.tsx`) ```ts +import { QueryClientProvider } from "@tanstack/react-query"; import { persistQueryClient } from "@tanstack/react-query-persist-client"; persistQueryClient({