useIsClient
Custom hook that determines if the code is running on the client side (in the browser).
Installation
npx sse-tool add use-is-client
npm install sse-hooks
Usage
import { useIsClient } from "./{hooks file}";
const isClient = useIsClient();
// Use isClient to conditionally render or execute code specific to the client side.
import { useIsClient } from "sse-hooks";
const isClient = useIsClient();
// Use isClient to conditionally render or execute code specific to the client side.
API
Return Value
Returns boolean.
A boolean value indicating whether the code is running on the client side.