import { useLayoutEffect } from 'react' ; const useLockBodyScroll = ( shouldBlock ) => { useLayoutEffect ( function useLockBodyScrollEffect ( ) { document . body . style . overflow = shouldBlock ? 'hidden' : 'visible' ; } , [ shouldBlock ] ) ; } ; export { useLockBodyScroll } ;