useIsClient
Custom hook that determines if the code is running on the client side (in the browser).
Installation
npx sse-hooks add use-is-client
yarn dlx sse-hooks add use-is-client
pnpm dlx sse-hooks add use-is-client
deno run -A npm:sse-hooks add use-is-client
bunx sse-hooks add use-is-client
Usage
example.ts
import { useIsClient } from "./{hooks file}";
const isClient = useIsClient();
// Use isClient to conditionally render or execute code specific to the client side.
API
Parameters
| Prop | Default | Type |
|---|
Returns
| Return Value | Default | Type |
|---|---|---|
return | - |
Hook return value |
Types Aliases
No specific type aliases defined for this component.