usePassiveLayoutEffect()

Bundlephobia Types Build status NPM Version MIT License

npm i @react-hook/passive-layout-effect

A React hook that uses `useEffect()` on the server and `useLayoutEffect()` in the browser ## Quick Start ```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]) } ``` ## Full credit to [Dan Abramov](https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85) ## LICENSE MIT