import { FC, PropsWithChildren, useCallback, useState } from 'react' import VisibilitySensor from 'react-visibility-sensor' import { InnerWrapper } from '../general/lists/list-wrapper' export const LazyMount: FC< PropsWithChildren<{ className?: string; full?: boolean }> > = ({ children, className, full }) => { const [mounted, setMounted] = useState(false) const onChange = useCallback( (isVisible: boolean) => { if (isVisible) { setMounted(true) } }, [setMounted] ) return ( {mounted ? ( children ) : (
)}
) }