import { PropsWithChildren } from "react" ; import { useIsMountedState } from "../../utils/hookts" ; export default function ClientOnly ( { children , ... delegated } ) { const isMounted = useIsMountedState ( ) ; if ( ! isMounted ) { return null ; } return < div { ... delegated } > { children } < /div>; } export function ClientOnlyEmpty ( { children } ) { const isMounted = useIsMountedState ( ) ; if ( ! isMounted ) { return null ; } return < > { children } < />; }