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
| Value | Type | Description |
|---|---|---|
return | boolean | A boolean value indicating whether the code is running on the client side. |
useIntersectionObserver
Custom hook that tracks the intersection of a DOM element with its containing element or the viewport using the [`Intersection Observer API`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
useIsMounted
Custom hook that determines if the component is currently mounted.