A React hook that uses useEffect() on the server and useLayoutEffect() in the browser
npm install @react-hook/passive-layout-effectnpm i @react-hook/passive-layout-effect
A React hook that uses useEffect() on the server and useLayoutEffect() in the browser
``jsx harmony
import useLayoutEffect from '@react-hook/passive-layout-effect'
const Component = ({foo, bar}) => {
// Used the same way useEffect() and useLayoutEffect() are
useLayoutEffect(() => {}, [foo, bar])
}
``
MIT