A hook that returns whether the code is running on the client.
isClientboolean| Prop | Type | Default |
|---|---|---|
isClient | boolean | - |
import { useClient } from '@k8ordo/ui';const isClient = useClient();
if (!isClient) {
return <p>Loading...</p>;
}
return <p>Window width: {window.innerWidth}px</p>;