JSPM

@react-hook/passive-layout-effect

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 765300
  • Score
    100M100P100Q217163F
  • License MIT

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

Package Exports

  • @react-hook/passive-layout-effect

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@react-hook/passive-layout-effect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bundlephobia MIT license


@react-hook/passive-layout-effect

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

Installation

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

yarn add @react-hook/passive-layout-effect

Usage

import usePassiveLayoutEffect from '@react-hook/passive-layout-effect'

const F = ({foo, bar}) => {
  // Used the same way useEffect() and useLayoutEffect() are
  usePassiveLayoutEffect(() => {}, [foo, bar])
}

Full credit to

Dan Abramov

LICENSE

MIT