Advanced / Manual Hydration

isHydrating

Whether the code running now is claiming server-rendered DOM: the root pass of hydrate(), or code under a streamed <Loading> boundary while that boundary resumes. false on the server, in client-only renders, after hydration, and in a render a resume window triggers outside the resuming boundary (that render builds fresh DOM).

Not reactive: read it where a component or primitive is created. While it is true, render what the server rendered, and switch to the client-only value from onSettled.


Import

import { isHydrating } from "solid-js";

Type signature

function isHydrating(): boolean;

Examples

const [width, setWidth] = createSignal(isHydrating() ? 0 : el.offsetWidth);
onSettled(() => {
setWidth(el.offsetWidth);
});

Learn more

Last updated: 9/30/26, 8:28 PMEdit this pageReport an issue with this page