1.2.1 • Published 4 years ago

@react-hook/passive-layout-effect v1.2.1

Weekly downloads
55,703
License
MIT
Repository
github
Last release
4 years ago

A React hook that uses useEffect() on the server and useLayoutEffect() in the browser

Quick Start

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

LICENSE

MIT