Skip to content

The Open Source DocuSign Alternative.

277 B
Raw Blame
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;
};