Components / Transitions and utilities
NoSsr
Renders children only in the browser, after hydration (e.g. things that read window or localStorage).
import { NoSsr } from "@stylhero/ui";
Example
Code
import { NoSsr, Skeleton, Text } from "@stylhero/ui";
function NoSsrExample() {
return <NoSsr fallback={<Skeleton width={180} />}><Text>Local time: {new Date().toLocaleTimeString()}</Text></NoSsr>;
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children required |
ReactNode |
- | |
fallback |
ReactNode |
null |
Generated from src/utils.tsx. Something wrong or missing? Open an issue.