Open History to see the last commit
1---
2id: useIsRestoring
3title: useIsRestoring
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8```ts
9function useIsRestoring(): Box<boolean>;
10```
11β
12Defined in: [packages/svelte-query/src/useIsRestoring.ts:23](https://github.com/TanStack/query/blob/main/packages/svelte-query/src/useIsRestoring.ts#L23)
13β
14If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` function alongside it to
15check if a restore is currently in progress. `createQuery` and friends also check this internally to avoid
16race conditions between the restore and mounting queries.
17β
18## Returns
19β
20`Box`\<`boolean`\>
21β
22A reactive box β read `.current` for `true` while a persisted client is being restored, `false`
23otherwise.
24β
25## Example
26β
27```svelte
28<script lang="ts">
29 import { useIsRestoring } from '@tanstack/svelte-query'
30β
31 const isRestoring = useIsRestoring()
32</script>
33β
34{#if isRestoring.current}
35 <div>Restoring cached data...</div>
36{/if}
37```