useIsClient

Custom hook that determines if the code is running on the client side (in the browser).

Custom hook that determines if the code is running on the client side (in the browser).

Usage

import { useIsClient } from "@tilt-legal/cubitt-components/utilities/hooks";

const isClient = useIsClient();
// Use isClient to conditionally render or execute code specific to the client side.

API

Signature

declare function useIsClient(): boolean;

Parameters

This hook takes no arguments.

Return Value

ValueTypeDescription
returnbooleanA boolean value indicating whether the code is running on the client side.

On this page