Files
documenso/packages/ui/components/client-only.tsx
T
2026-05-08 16:04:22 +10:00

11 lines
277 B
TypeScript

import { useHydrated } from '../lib/use-hydrated';
type ClientOnlyProps = {
children: () => React.ReactNode;
fallback?: React.ReactNode;
};
export const ClientOnly = ({ children, fallback = null }: ClientOnlyProps) => {
return useHydrated() ? children() : fallback;
};