You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/react/devtools.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,7 @@ Wave your hands in the air and shout hooray because React Query comes with dedic
7
7
8
8
When you begin your React Query journey, you'll want these devtools by your side. They help visualize all the inner workings of React Query and will likely save you hours of debugging if you find yourself in a pinch!
9
9
10
-
> Please note that for now, the devtools **do not support React Native**. If you would like to help us make the devtools platform-agnostic, please let us know!
11
-
12
-
> Exciting News: We now have a separate package for React Native React Query DevTools! This new addition brings native support, allowing you to integrate DevTools directly into your React Native projects. Check it out and contribute here: [react-native-react-query-devtools](https://github.com/LovesWorking/react-native-react-query-devtools)
13
-
14
-
> An external tool is also available that enables the use of React Query DevTools via an external dashboard. Find out more and contribute on [react-query-external-sync](https://github.com/LovesWorking/react-query-external-sync)
10
+
> For React Native users: A third-party native macOS app is available for debugging React Query in ANY js-based application. Monitor queries across devices in real-time. Check it out here: [rn-better-dev-tools](https://github.com/LovesWorking/rn-better-dev-tools)
15
11
16
12
> Note that since version 5, the dev tools support observing mutations as well.
Copy file name to clipboardExpand all lines: docs/framework/react/plugins/createPersister.md
+68-15Lines changed: 68 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
id: createPersister
3
-
title: experimental_createPersister
3
+
title: experimental_createQueryPersister
4
4
---
5
5
6
6
## Installation
@@ -33,9 +33,9 @@ bun add @tanstack/query-persist-client-core
33
33
34
34
## Usage
35
35
36
-
- Import the `experimental_createPersister` function
37
-
- Create a new `experimental_createPersister`
38
-
- you can pass any `storage` to it that adheres to the `AsyncStorage`or `Storage`interface - the example below uses the async-storage from React Native.
36
+
- Import the `experimental_createQueryPersister` function
37
+
- Create a new `experimental_createQueryPersister`
38
+
- you can pass any `storage` to it that adheres to the `AsyncStorage` interface - the example below uses the async-storage from React Native.
39
39
- Pass that `persister` as an option to your Query. This can be done either by passing it to the `defaultOptions` of the `QueryClient` or to any `useQuery` hook instance.
40
40
- If you pass this `persister` as `defaultOptions`, all queries will be persisted to the provided `storage`. You can additionally narrow this down by passing `filters`. In contrast to the `persistClient` plugin, this will not persist the whole query client as a single item, but each query separately. As a key, the query hash is used.
41
41
- If you provide this `persister` to a single `useQuery` hook, only this Query will be persisted.
@@ -48,16 +48,18 @@ Garbage collecting a Query from memory **does not** affect the persisted data. T
@@ -67,12 +69,62 @@ const queryClient = new QueryClient({
67
69
68
70
The `createPersister` plugin technically wraps the `queryFn`, so it doesn't restore if the `queryFn` doesn't run. In that way, it acts as a caching layer between the Query and the network. Thus, the `networkMode` defaults to `'offlineFirst'` when a persister is used, so that restoring from the persistent storage can also happen even if there is no network connection.
69
71
72
+
## Additional utilities
73
+
74
+
Invoking `experimental_createQueryPersister` returns additional utilities in addition to `persisterFn` for easier implementation of userland functionalities.
This function can be used to restore all queries that are currently stored by persister in one go.
117
+
For example when your app is starting up in offline mode, or you want data from previous session to be immediately available without intermediate `loading` state.
118
+
119
+
For this function to work, your storage must expose `entries` method that would return a `key-value tuple array`.
120
+
For example `Object.entries(localStorage)` for `localStorage` or `entries` from `idb-keyval`.
Copy file name to clipboardExpand all lines: docs/framework/react/react-native.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,20 @@ id: react-native
3
3
title: React Native
4
4
---
5
5
6
-
React Query is designed to work out of the box with React Native, with the exception of the devtools, which are only supported with React DOM at this time.
6
+
React Query is designed to work out of the box with React Native.
7
7
8
-
There is a 3rd party [Expo](https://docs.expo.dev/) plugin which you can try: https://github.com/expo/dev-plugins/tree/main/packages/react-query
8
+
## DevTools Support
9
9
10
-
There is a 3rd party [Flipper](https://fbflipper.com/docs/getting-started/react-native/) plugin which you can try: https://github.com/bgaleotti/react-query-native-devtools
10
+
There are several options available for React Native DevTools integration:
11
11
12
-
There is a 3rd party [Reactotron](https://github.com/infinitered/reactotron/) plugin which you can try: https://github.com/hsndmr/reactotron-react-query
12
+
1.**Native macOS App**: A 3rd party app for debugging React Query in any js-based application:
Copy file name to clipboardExpand all lines: docs/framework/vue/plugins/createPersister.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
id: createPersister
3
-
title: experimental_createPersister
3
+
title: experimental_createQueryPersister
4
4
---
5
5
6
6
## Installation
@@ -31,8 +31,8 @@ bun add @tanstack/query-persist-client-core
31
31
32
32
## Usage
33
33
34
-
- Import the `experimental_createPersister` function
35
-
- Create a new `experimental_createPersister`
34
+
- Import the `experimental_createQueryPersister` function
35
+
- Create a new `experimental_createQueryPersister`
36
36
- you can pass any `storage` to it that adheres to the `AsyncStorage` or `Storage` interface
37
37
- Pass that `persister` as an option to your Query. This can be done either by passing it to the `defaultOptions` of the `QueryClient` or to any `useQuery` hook instance.
38
38
- If you pass this `persister` as `defaultOptions`, all queries will be persisted to the provided `storage`. You can additionally narrow this down by passing `filters`. In contrast to the `persistClient` plugin, this will not persist the whole query client as a single item, but each query separately. As a key, the query hash is used.
@@ -44,16 +44,18 @@ Garbage collecting a Query from memory **does not** affect the persisted data. T
0 commit comments