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