Usage
The ClientOnly component wraps content that should only render on the client side, preventing server-side rendering hydration mismatches.
A utility component that renders its children only on the client side, preventing SSR hydration mismatches.
The ClientOnly component wraps content that should only render on the client side, preventing server-side rendering hydration mismatches.
You can provide a fallback prop to display content during server-side rendering or before client hydration completes.
Loading client content...
Common scenarios where ClientOnly is useful:
Detecting browser...
Prop | Default | Type |
|---|---|---|
children | undefined | React.ReactNode |
fallback | null | React.ReactNode |