Files
documenso/packages/ui/components/client-only.tsx
2025-11-22 20:28:20 +11:00

11 lines
291 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}</>;
};