mirror of
https://github.com/documenso/documenso.git
synced 2025-11-23 05:01:54 +10:00
11 lines
291 B
TypeScript
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}</>;
|
|
};
|