Skip to content
usefy

useIsClient

Lifecycle & refs

Returns true once the component has hydrated on the client (SSR-safe)

Install

$ npm install @usefy/use-is-client

Quick start

useIsClient.tsx
import { useIsClient } from "@usefy/use-is-client";

const isClient = useIsClient();
return isClient ? <ClientOnly /> : <ServerFallback />;

API reference

useIsClient(): booleanfalse on the server and the first render, true after hydration.

Go deeper

This page is the quick reference. For every example, prop, and edge case, read the full README — or open Storybook to change props live.

More in lifecycle & refs