function hydrate(config, initialState?): HydrateResult;Defined in: account-kit/core/src/hydrate.ts:37
Will hydrate the client store with the provided initial state if one is provided.
import { hydrate, cookieToInitialState } from "@account-kit/core";
import { config } from "./config";
const initialState = cookieToInitialState(document.cookie);
const { onMount } = hydrate(config, initialState);
// call onMount once your component has mounted| Parameter | Type | Description |
|---|---|---|
| the config containing the client store | |
| optional param detailing the initial ClientState |
HydrateResult
an object containing an onMount function that can be called when your component first renders on the client