Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

useIsRestoring.md

22 lines695 Bytes

1---
2id: useIsRestoring
3title: useIsRestoring
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8```ts
9function useIsRestoring(): boolean;
10```
11​
12Defined in: [packages/react-query/src/IsRestoringProvider.ts:12](https://github.com/TanStack/query/blob/main/packages/react-query/src/IsRestoringProvider.ts#L12)
13​
14If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to
15check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid
16race conditions between the restore and mounting queries.
17​
18## Returns
19​
20`boolean`
21​
22`true` while a persisted client is being restored, `false` otherwise.