Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TanStack · Class

IsRestoringProvider

IsRestoringProvider is the Solid context provider for persisted query-client restoration state. It exposes an accessor<boolean> that useIsRestoring and query primitives can consume.

How it works

IsRestoringProvider is the Solid context provider used to expose persisted-client restoration state. PersistQueryClientProvider supplies this state, while useIsRestoring reads it and query primitives use it internally to avoid restore-related races.

Syntax

const IsRestoringProvider: ContextProviderComponent<Accessor<boolean>> = IsRestoringContext.Provider;

Key points

  • The exported value is the Solid context provider, typed to accept an accessor of boolean state.
  • PersistQueryClientProvider uses it to publish restoration status to the query context.
  • Its boolean state represents whether persisted query-client restoration is in progress.
  • The companion useIsRestoring primitive is the documented consumer for this context.

Common mistakes

  • This provider is generally supplied by PersistQueryClientProvider; manually replacing it means your value must accurately represent the active restore operation.
  • Consumers should read the context through useIsRestoring rather than depending on the provider object directly.

Example: Providing restore state

import { createSignal } from "solid-js";
import { IsRestoringProvider, useIsRestoring } from "@tanstack/solid-query";

function RestoreStatus() {
  const restoring = useIsRestoring();
  return <span>{restoring() ? "Restoring…" : "Ready"}</span>;
}

export function App() {
  const [isRestoring] = createSignal(false);
  return (
    <IsRestoringProvider value={isRestoring}>
      <RestoreStatus />
    </IsRestoringProvider>
  );
}

Provides a Solid accessor through context so a descendant can read whether persisted query state is being restored.

When to use it

Expose restoration progress to descendants

Persisted-cache startup

Supply restore state through Solid context

Custom persistence integration

Render UI that reflects cache restoration

Loading-state coordination

Interview questions

QWhat is IsRestoringProvider?

It is a Solid context provider whose value has type Accessor<boolean>. Its purpose is to expose whether a persisted query client is currently being restored.

Follow-up: How is the value normally populated? PersistQueryClientProvider uses this provider to publish the restore state.

QHow is the provider consumed?

The provider communicates restoration status to descendants through context. useIsRestoring reads that status, while query APIs also check it internally.

Follow-up: Why does that internal check matter? It helps prevent race conditions between restoring persisted state and mounting queries.

QWhat is its type and declaration?

The documented declaration is const IsRestoringProvider: ContextProviderComponent<Accessor<boolean>> = IsRestoringContext.Provider;. Therefore, the supplied value is a Solid accessor returning a boolean.

Follow-up: What should the accessor return? It should be true during persisted-client restoration and false once restoration has finished.

  • PersistQueryClientProvider
  • useIsRestoring
  • IsRestoringContext

Source: IsRestoringProvider | TanStack Query Solid Docs. Checked 2026-10-16.