Skip to content

useHydrated

Checks if the configuration store has been hydrated (i.e., loaded from persistent storage).

Import

ts
import { useHydrated } from "@midl/react";

Example

tsx
function App() {
  const hydrated = useHydrated();

  if (!hydrated) return <div>Loading...</div>;

  return <div>App is hydrated!</div>;
}

Parameters

NameTypeDescription
configConfig(optional) Custom config to override the default from context.

Returns

TypeDescription
booleanWhether the config store is hydrated or not.