{"name":"use-isomorphic-layout-effect","version":"1.2.1","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","husky":"^9.1.7","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}},"packageManager":"pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977","_id":"use-isomorphic-layout-effect@1.2.1","gitHead":"711b17523cce55ec5ecb64500c8234fe8f8a046b","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"integrity":"sha512-tpZZ+EX0gaghDAiFR37hj5MgY6ZN55kLiPkJsKxBMZ6GZdOSPJXiOzPM984oPYZ5AnehYx5WQp1+ME8I/P/pRA==","shasum":"2f11a525628f56424521c748feabc2ffcc962fce","tarball":"http://registry-npm.ywwl.com/use-isomorphic-layout-effect/download/use-isomorphic-layout-effect-1.2.1.tgz","fileCount":15,"unpackedSize":6902,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAgOp1v7i/vE5UPm7nvjyCdFFkVoIsIGCMvok6B/u7k7AiEAj2ORM0W2SQG6QucyFydSe5La96VPgCS13wizo/IhSfk="}],"size":2864,"noattachment":false,"key":"/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.1.tgz"},"_npmUser":{"name":"andarist","email":"mateuszburzynski@gmail.com"},"directories":{},"maintainers":[{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/use-isomorphic-layout-effect_1.2.1_1747432694221_0.523853238426254"},"_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":1747432694383,"_cnpm_publish_time":1747432694383,"dist-tags":{"latest":"1.2.1"}}