{"name":"use-isomorphic-layout-effect","version":"1.2.0","description":"A React helper hook for scheduling a layout effect with a fallback to a regular effect for environments where layout effects should not be used (such as server-side rendering).","main":"dist/use-isomorphic-layout-effect.cjs.js","module":"dist/use-isomorphic-layout-effect.esm.js","react-native":"./dist/use-isomorphic-layout-effect.browser.esm.js","browser":{"./dist/use-isomorphic-layout-effect.esm.js":"./dist/use-isomorphic-layout-effect.browser.esm.js"},"types":"./dist/use-isomorphic-layout-effect.cjs.d.ts","exports":{".":{"types":{"import":"./dist/use-isomorphic-layout-effect.cjs.mjs","default":"./dist/use-isomorphic-layout-effect.cjs.js"},"browser":{"module":"./dist/use-isomorphic-layout-effect.browser.esm.js","import":"./dist/use-isomorphic-layout-effect.browser.cjs.mjs","default":"./dist/use-isomorphic-layout-effect.browser.cjs.js"},"react-native":{"module":"./dist/use-isomorphic-layout-effect.browser.esm.js","import":"./dist/use-isomorphic-layout-effect.browser.cjs.mjs","default":"./dist/use-isomorphic-layout-effect.browser.cjs.js"},"module":"./dist/use-isomorphic-layout-effect.esm.js","import":"./dist/use-isomorphic-layout-effect.cjs.mjs","default":"./dist/use-isomorphic-layout-effect.cjs.js"},"./package.json":"./package.json"},"imports":{"#is-client":{"react-native":"./src/conditions/true.ts","browser":"./src/conditions/true.ts","default":"./src/conditions/is-client.ts"}},"scripts":{"test":"echo \"Warning: no test specified\"","build":"preconstruct build","prepare":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/Andarist/use-isomorphic-layout-effect.git"},"license":"MIT","bugs":{"url":"https://github.com/Andarist/use-isomorphic-layout-effect/issues"},"homepage":"https://github.com/Andarist/use-isomorphic-layout-effect#readme","peerDependencies":{"react":"^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"},"peerDependenciesMeta":{"@types/react":{"optional":true}},"devDependencies":{"@babel/core":"^7.26.0","@babel/preset-env":"^7.26.0","@babel/preset-typescript":"^7.26.0","@preconstruct/cli":"^2.8.10","@types/react":"^19.0.0","cpy-cli":"^3.1.1","husky":"^4.2.5","lint-staged":"^10.2.11","prettier":"^3.4.2","react":"^19.0.0","typescript":"^5.7.2"},"preconstruct":{"exports":{"importConditionDefaultExport":"default"},"___experimentalFlags_WILL_CHANGE_IN_PATCH":{"importsConditions":true}},"_id":"use-isomorphic-layout-effect@1.2.0","gitHead":"22f43ee56bbb8f0686acd870b546530af5cb8f5d","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"integrity":"sha512-q6ayo8DWoPZT0VdG4u3D3uxcgONP3Mevx2i2b0434cwWBoL+aelL1DzkXI6w3PhTZzUeR2kaVlZn70iCiseP6w==","shasum":"afb292eb284c39219e8cb8d3d62d71999361a21d","tarball":"http://registry-npm.ywwl.com/use-isomorphic-layout-effect/download/use-isomorphic-layout-effect-1.2.0.tgz","fileCount":15,"unpackedSize":6720,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhdee7JQK0MEE8DCesn5QU64+78mzO2EYD+dtqa5WXtwIhAKFpIWdK9/dnt15GT4rn6EmHbKeckoc7zC41QrYQgMTp"}],"size":2724,"noattachment":false,"key":"/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.0.tgz"},"_npmUser":{"name":"andarist","email":"mateuszburzynski@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-isomorphic-layout-effect_1.2.0_1733484808133_0.11654766321758525"},"_hasShrinkwrap":false,"readme":"# use-isomorphic-layout-effect\n\nA React helper hook for scheduling a layout effect with a fallback to a regular effect for environments where layout effects should not be used (such as server-side rendering).\n\n## Installation\n\n```sh\n$ npm i use-isomorphic-layout-effect\n```\n\n## Usage \n\nYou only need to switch `useLayoutEffect` with `useIsomorphicLayoutEffect`\n\n```diff\n+ import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\n- import { useLayoutEffect } from 'react';\n\n\nconst YourComponent = () => {\n+  useIsomorphicLayoutEffect(() => {\n-  useLayoutEffect(() => {\n    // your implementation\n  }, []);\n};\n```\n","publish_time":1733484808315,"maintainers":[{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"_cnpm_publish_time":1733484808315,"dist-tags":{"latest":"1.2.1"}}