Skip to content

Hydrate

A react component that can be used to hydrate the client store with the provided initial state. This method will use hydrate to hydrate the client store with the provided initial state if one is provided. If ssr is set on the account config, then it will run the onMount function within a useEffect hook. Otherwise, It will run onMount as soon as the compoonent is rendered.

based on https://github.com/wevm/wagmi/blob/main/packages/react/src/hydrate.ts

Import

import { Hydrate } from "@account-kit/react";

Parameters

props

PropsWithChildren<HydrateProps> component props containing the config and initial state as well as children to render

props.config

AlchemyAccountsConfig the account config containing the client store

props.initialState

AlchemyClientState | undefined optional param detailing the initial ClientState

props.children

React.ReactNode the children to render

Returns

React.ReactNode the children to render