{"_id":"use-effect-event","_rev":"7-161909c9c2007198c6f72eb859aed0e7","name":"use-effect-event","dist-tags":{"latest":"2.0.4"},"versions":{"1.0.1":{"name":"use-effect-event","version":"1.0.1","keywords":["useEffectEvent","useEvent","hooks","react","react18","react19","sanity","sanity-io","typescript","effect","use"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"use-effect-event@1.0.1","maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"contributors":[{"url":"https://github.com/stipsan","name":"Cody Olsen","email":"stipsan@gmail.com"}],"homepage":"https://github.com/sanity-io/use-effect-event#readme","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"5f529adc2b3a74805a8c05cdccfe121f912e3808","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-1.0.1.tgz","fileCount":9,"integrity":"sha512-NtP6eK+Hg066CwYGDZDYx/K+xeaXeYinV99ZXS3SLAxNkOUaGcTwkflGkc6HaemNzvN99t7ksUpfuQxV28wj4w==","signatures":[{"sig":"MEUCIQCJaYnMql4gDGaqOlt9tF12C7F6f9NLwFj9tDFCULtvAAIgZWvnAuwFkKkNnJ/qNHs6sKBdSHJmhl9G+FUYivkDf08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":8936},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"source":"./src/index.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"816125710b9b86bb673a0b0deaae83e8e9102437","scripts":{"lint":"eslint --cache .","build":"pkg build --strict --clean --check","watch":"pnpm build -- --watch","format":"prettier --cache --write .","prepublishOnly":"pnpm build"},"_npmUser":{"name":"sanity-io","email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"_npmVersion":"10.7.0","description":"Ponyfill of the experimental `React.useEffectEvent` hook","directories":{},"sideEffects":false,"_nodeVersion":"20.15.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.5.0","devDependencies":{"react":"^18.3.1","eslint":"^8.57.0","prettier":"^3.3.2","react-dom":"^18.3.1","typescript":"5.5.3","@types/node":"^18.17.5","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","semantic-release":"^24.0.0","@sanity/pkg-utils":"^6.10.2","eslint-plugin-react":"^7.34.3","@testing-library/dom":"^10.3.1","@testing-library/react":"^16.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@sanity/prettier-config":"^1.0.2","@typescript-eslint/parser":"^7.16.0","eslint-plugin-react-hooks":"^4.6.2","eslint-plugin-react-compiler":"0.0.0-experimental-0998c1e-20240625","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^7.16.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/use-effect-event_1.0.1_1720569637165_0.6260429922307023","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"use-effect-event","version":"1.0.2","keywords":["useEffectEvent","useEvent","hooks","react","react18","react19","sanity","sanity-io","typescript","effect","use"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"use-effect-event@1.0.2","maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"contributors":[{"url":"https://github.com/stipsan","name":"Cody Olsen","email":"stipsan@gmail.com"}],"homepage":"https://github.com/sanity-io/use-effect-event#readme","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"426bde4a166e762592005f194550e36639d39c7c","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-1.0.2.tgz","fileCount":9,"integrity":"sha512-9c8AAmtQja4LwJXI0EQPhQCip6dmrcSe0FMcTUZBeGh/XTCOLgw3Qbt0JdUT8Rcrm/ZH+Web7MIcMdqgQKdXJg==","signatures":[{"sig":"MEUCIDj4XPfoAEXKa3+JChW8NHkmIk3uDGDc7tDAl7MENdlKAiEAnDzQOX4JzTPtR+sUm8rsVip2i02lUVAtwmAFdEBaEwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9509},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"source":"./src/index.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"11c565abe23f483e1bdcb43f4ad38f774d6e6973","scripts":{"lint":"eslint --cache .","build":"pkg build --strict --clean --check","watch":"pnpm build -- --watch","format":"prettier --cache --write .","prepublishOnly":"pnpm build"},"_npmUser":{"name":"sanity-io","email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"_npmVersion":"10.7.0","description":"Ponyfill of the experimental `React.useEffectEvent` hook","directories":{},"sideEffects":false,"_nodeVersion":"20.15.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.5.0","devDependencies":{"react":"^18.3.1","eslint":"^8.57.0","prettier":"^3.3.2","react-dom":"^18.3.1","typescript":"5.5.3","@types/node":"^18.17.5","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","semantic-release":"^24.0.0","@sanity/pkg-utils":"^6.10.2","eslint-plugin-react":"^7.34.3","@testing-library/dom":"^10.3.1","@testing-library/react":"^16.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@sanity/prettier-config":"^1.0.2","@typescript-eslint/parser":"^7.16.0","eslint-plugin-react-hooks":"^4.6.2","eslint-plugin-react-compiler":"0.0.0-experimental-0998c1e-20240625","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^7.16.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/use-effect-event_1.0.2_1720571054746_0.13525574908485116","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"use-effect-event","version":"2.0.0","keywords":["useEffectEvent","useEvent","hooks","react","react18","react19","sanity","sanity-io","typescript","effect","use"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"use-effect-event@2.0.0","maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"contributors":[{"url":"https://github.com/stipsan","name":"Cody Olsen","email":"stipsan@gmail.com"}],"homepage":"https://github.com/sanity-io/use-effect-event#readme","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"4b97df91e876ca2e5bb5e81d463c33691f1c1624","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-2.0.0.tgz","fileCount":9,"integrity":"sha512-CIRGe/RUfngbmivpY5F7rc0m7q0VYzqtQOcKJ19FPEeyf7tS44Zk+9tcDicP+z+d32+E2r+Zs7+20MHXa8JBUA==","signatures":[{"sig":"MEYCIQC3mL01OAHmz2g65UlIidYvqJxQf/mLz61hLQWmNTbRQwIhANjHkw45atsXoXuUNzj9ZXXK2XZ+eHuFWZGV9DKLmIlJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":10834},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"source":"./src/index.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"03dd5778952a6484ce5393ff698d32c77c1148f9","scripts":{"lint":"eslint --cache .","test":"vitest","build":"pkg build --strict --clean --check","watch":"pnpm build -- --watch","format":"prettier --cache --write .","prepublishOnly":"pnpm build"},"_npmUser":{"name":"sanity-io","email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"_npmVersion":"10.9.2","description":"Ponyfill of the experimental `React.useEffectEvent` hook","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.14.4","devDependencies":{"jsdom":"^26.1.0","react":"^18.3.1","eslint":"^8.57.1","vitest":"^3.1.4","prettier":"^3.4.1","react-dom":"^18.3.1","typescript":"5.7.2","@types/node":"^18.17.5","@types/react":"^18.3.20","@types/react-dom":"^18.3.6","semantic-release":"^24.1.0","@sanity/pkg-utils":"^7.2.2","eslint-plugin-react":"^7.37.2","@testing-library/dom":"^10.4.0","@vitejs/plugin-react":"^4.4.1","@testing-library/react":"^16.0.1","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","@sanity/prettier-config":"^1.0.3","@typescript-eslint/parser":"^8.16.0","eslint-plugin-react-hooks":"0.0.0-experimental-23884812-20250520","eslint-plugin-react-compiler":"0.0.0-experimental-0998c1e-20240625","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^8.16.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/use-effect-event_2.0.0_1748016101072_0.5027278188471482","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"use-effect-event","version":"2.0.1","keywords":["useEffectEvent","useEvent","hooks","react","react18","react19","sanity","sanity-io","typescript","effect","use"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"use-effect-event@2.0.1","maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"contributors":[{"url":"https://github.com/stipsan","name":"Cody Olsen","email":"stipsan@gmail.com"}],"homepage":"https://github.com/sanity-io/use-effect-event#readme","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"903675dafede95cefa4373fbc5066218976c8c01","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-2.0.1.tgz","fileCount":9,"integrity":"sha512-76rGQGL83WpjyqrYNsQXA9U7y68HNfeGecBz7q8jvEGXucnh0oUedjxHuOmwVucv8kzpHOYx6OlrLAuQ66fvbg==","signatures":[{"sig":"MEUCIQDxdEbQ9gypwJDD7k3WLHnTVMsdMrnmF/KNqq8chhmtlwIgR7p5nozLbhYCMHv5TIwPUUbEoljpya59vw/pQn7eqOI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15189},"main":"./dist/index.cjs","pnpm":{"peerDependencyRules":{"allowAny":["react","react-dom"]}},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"source":"./src/index.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"ad7457478303f9dd454beb8687055fa90df54a2c","scripts":{"lint":"eslint --cache .","test":"vitest","build":"pkg build --strict --clean --check","watch":"pnpm build -- --watch","format":"prettier --cache --write .","prepare":"pnpm build"},"_npmUser":{"name":"sanity-io","email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"_npmVersion":"10.9.2","description":"Ponyfill of the experimental `React.useEffectEvent` hook","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.12.1","devDependencies":{"jsdom":"^26.1.0","react":"^19.1.0","eslint":"^8.57.1","vitest":"^3.2.3","prettier":"^3.5.3","react-dom":"^19.1.0","typescript":"5.8.3","@types/node":"^22.15.23","@types/react":"^19.1.8","@types/react-dom":"^19.1.6","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.2.4","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.0","@vitejs/plugin-react":"^4.5.2","@testing-library/react":"^16.3.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.1","@sanity/prettier-config":"^1.0.3","@typescript-eslint/parser":"^8.34.0","eslint-plugin-react-hooks":"0.0.0-experimental-f9ae0a4c-20250527","prettier-plugin-packagejson":"^2.5.15","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^8.34.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/use-effect-event_2.0.1_1749670543227_0.4821061430905258","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"use-effect-event","version":"2.0.2","keywords":["useEffectEvent","useEvent","hooks","react","react18","react19","sanity","sanity-io","typescript","effect","use"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"use-effect-event@2.0.2","maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"contributors":[{"url":"https://github.com/stipsan","name":"Cody Olsen","email":"stipsan@gmail.com"}],"homepage":"https://github.com/sanity-io/use-effect-event#readme","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"75d983b5960cf2b8e967edfa266697db42ea55c6","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-2.0.2.tgz","fileCount":9,"integrity":"sha512-IGikKu2QMAjtBUc3basvXjYvAXvGAMTVmcz9S2cuuRDEGH142Ez4ctiOzhsw3HGNZoFSB2a+0c4OHpT1OTw3Og==","signatures":[{"sig":"MEUCIQCXh0OOH5PXYOqxlqe0KhBEAIHVhWx+62mcU0RKSwnO6gIgEC5Xl6ljAvJV7DrFH0EkfuzIQFO78EgLEFzr7Vq0qJs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@2.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15238},"main":"./dist/index.cjs","pnpm":{"peerDependencyRules":{"allowAny":["react","react-dom"]}},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"source":"./src/index.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"f4e403ab1321c07049d4bb3dac1705bd0ba5da58","scripts":{"lint":"eslint --cache .","test":"vitest","build":"pkg build --strict --clean --check","watch":"pnpm build -- --watch","format":"prettier --cache --write .","prepare":"pnpm build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"sanity-io","actor":{"name":"sanity-io","type":"user","email":"developers@sanity.io"},"email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"_npmVersion":"10.9.2","description":"Ponyfill of the experimental `React.useEffectEvent` hook","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.12.1","devDependencies":{"jsdom":"^26.1.0","react":"^19.1.0","eslint":"^8.57.1","vitest":"^3.2.4","prettier":"^3.5.3","react-dom":"^19.1.0","typescript":"5.8.3","@types/node":"^22.15.23","@types/react":"^19.1.8","@types/react-dom":"^19.1.6","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.2","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.0","@vitejs/plugin-react":"^4.5.2","@testing-library/react":"^16.3.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@typescript-eslint/parser":"^8.34.1","eslint-plugin-react-hooks":"0.0.0-experimental-f9ae0a4c-20250527","prettier-plugin-packagejson":"^2.5.15","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^8.34.1","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/use-effect-event_2.0.2_1750424416554_0.5061057813678342","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"use-effect-event","version":"2.0.3","keywords":["useEffectEvent","useEvent","hooks","react","react18","react19","sanity","sanity-io","typescript","effect","use"],"author":{"name":"Sanity.io","email":"hello@sanity.io"},"license":"MIT","_id":"use-effect-event@2.0.3","maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"contributors":[{"url":"https://github.com/stipsan","name":"Cody Olsen","email":"stipsan@gmail.com"}],"homepage":"https://github.com/sanity-io/use-effect-event#readme","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"9e013702d37dc9f8930c7717d9cfdb3804b23240","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-2.0.3.tgz","fileCount":9,"integrity":"sha512-fz1en+z3fYXCXx3nMB8hXDMuygBltifNKZq29zDx+xNJ+1vEs6oJlYd9sK31vxJ0YI534VUsHEBY0k2BATsmBQ==","signatures":[{"sig":"MEUCIE1dGX/a80z/1djR98jbRC/950h4HoBrQ50W36BrsO4TAiEArSblUyEOy1W1YN9lMx5gkuDv3KhYA+sE8jzGrwFJyHw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@2.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14910},"main":"./dist/index.cjs","pnpm":{"peerDependencyRules":{"allowAny":["react","react-dom"]}},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"source":"./src/index.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"5d0978bd99f19609e3e3699abc3395e75e6b0948","scripts":{"lint":"eslint --cache .","test":"vitest","build":"pkg build --strict --clean --check","watch":"pnpm build -- --watch","format":"prettier --cache --write .","prepare":"pnpm build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"sanity-io","email":"developers@sanity.io"},"prettier":"@sanity/prettier-config","repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"_npmVersion":"10.9.2","description":"Ponyfill of the experimental `React.useEffectEvent` hook","directories":{},"sideEffects":false,"_nodeVersion":"22.17.0","browserslist":"extends @sanity/browserslist-config","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.12.1","devDependencies":{"jsdom":"^26.1.0","react":"^19.1.0","eslint":"^8.57.1","vitest":"^3.2.4","prettier":"^3.5.3","react-dom":"^19.1.0","typescript":"5.8.3","@types/node":"^22.15.23","@types/react":"^19.1.8","@types/react-dom":"^19.1.6","semantic-release":"^24.2.5","@sanity/pkg-utils":"^7.8.2","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.0","@vitejs/plugin-react":"^4.5.2","@testing-library/react":"^16.3.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.0","@sanity/prettier-config":"^1.0.5","@typescript-eslint/parser":"^8.34.1","eslint-plugin-react-hooks":"0.0.0-experimental-f9ae0a4c-20250527","prettier-plugin-packagejson":"^2.5.15","@sanity/semantic-release-preset":"^5.0.0","@typescript-eslint/eslint-plugin":"^8.34.1","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/use-effect-event_2.0.3_1752678501987_0.13444255695495455","host":"s3://npm-registry-packages-npm-production"}},"2.0.4":{"_id":"use-effect-event@2.0.4","bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"dist":{"shasum":"90ed6101f7ebfa13ea6e5073f7590a87c388140b","tarball":"https://registry.npmjs.org/use-effect-event/-/use-effect-event-2.0.4.tgz","fileCount":11,"integrity":"sha512-il5ezAwTIxg1dr+eXP+1SS1EpXe6IFy1oADvGxmiCNGCDX1X+ygERRDOFoCyzc+r6ktqag3VITmrw1ZPfoig1g==","signatures":[{"sig":"MEYCIQCT5UruXu+BhDCM28CrZ2IBiLy4FHRhAIf9sUZo1KGxwAIhAMb4oRAS0C5dIuqKazOVGUKR95L/KrsxsoyqvwytbUc3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID1rFB4hemt9vd/weTdkqObrDtT0US61HlC0QmlTAoI2AiBaEmw79XtjATk4NLC0e597CmZpWN/E9GPVru9pWVW/Tg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/use-effect-event@2.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24387},"main":"./dist/index.cjs","name":"use-effect-event","type":"module","types":"./dist/index.d.cts","author":"Sanity.io <hello@sanity.io>","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"license":"MIT","scripts":{"lint":"oxlint","test":"vitest run","build":"tsdown","watch":"tsdown --watch","format":"oxfmt","release":"changeset publish"},"version":"2.0.4","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8b5d0219-1692-4cbf-b9b9-c9f79ce765f1"}},"keywords":["effect","hooks","react","react18","react19","sanity","sanity-io","typescript","use","useEffectEvent","useEvent"],"repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"description":"Ponyfill of the `React.useEffectEvent` hook, which became stable in React 19.2","directories":{},"maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"sideEffects":false,"_nodeVersion":"24.20.0","contributors":["Cody Olsen <stipsan@gmail.com> (https://github.com/stipsan)"],"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^30.0.1","oxfmt":"^0.65.0","react":"^19.2.8","oxlint":"^1.80.0","tsdown":"^0.22.14","vitest":"^4.1.11","publint":"^0.3.24","react-dom":"^19.2.8","typescript":"7.0.2","@types/node":"^24.13.3","@types/react":"^19.2.18","@changesets/cli":"^3.0.1","oxlint-tsgolint":"^7.0.2001","@sanity/tsconfig":"^2.2.1","@types/react-dom":"^19.2.5","oxc-transform-react":"^0.147.0","@testing-library/dom":"^10.4.1","@vitejs/plugin-react":"^6.1.0","@sanity/tsdown-config":"^0.26.2","@testing-library/react":"^16.3.2","@changesets/changelog-github":"^1.0.0"},"peerDependencies":{"react":"^18.3 || ^19.0.0-0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/use-effect-event_2.0.4_1787837096572_0.48473337901972324"}}},"time":{"created":"2024-07-10T00:00:37.073Z","modified":"2026-08-27T13:24:57.123Z","1.0.1":"2024-07-10T00:00:37.322Z","1.0.2":"2024-07-10T00:24:14.879Z","2.0.0":"2025-05-23T16:01:41.263Z","2.0.1":"2025-06-11T19:35:43.396Z","2.0.2":"2025-06-20T13:00:16.746Z","2.0.3":"2025-07-16T15:08:22.158Z","2.0.4":"2026-08-27T13:24:56.664Z"},"bugs":{"url":"https://github.com/sanity-io/use-effect-event/issues"},"author":"Sanity.io <hello@sanity.io>","license":"MIT","keywords":["effect","hooks","react","react18","react19","sanity","sanity-io","typescript","use","useEffectEvent","useEvent"],"repository":{"url":"git+https://github.com/sanity-io/use-effect-event.git","type":"git"},"description":"Ponyfill of the `React.useEffectEvent` hook, which became stable in React 19.2","contributors":["Cody Olsen <stipsan@gmail.com> (https://github.com/stipsan)"],"maintainers":[{"name":"sanity-io","email":"developers@sanity.io"}],"readme":"[![CI](https://github.com/sanity-io/use-effect-event/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/sanity-io/use-effect-event/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/use-effect-event.svg)](https://www.npmjs.com/package/use-effect-event)\n\n# use-effect-event\n\n> Ponyfill of the [`React.useEffectEvent`](https://react.dev/reference/react/useEffectEvent) hook, which became stable in React 19.2\n\n## Usage\n\n> [!IMPORTANT]\n> Make sure you read about [the limitations and understand them](https://react.dev/learn/separating-events-from-effects#limitations-of-effect-events) before you start using this hook, it's not a silver bullet.\n\nThis package implements the [same](https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event) [API](https://react.dev/learn/separating-events-from-effects#reading-latest-props-and-state-with-effect-events) as the native [`React.useEffectEvent`](https://react.dev/reference/react/useEffectEvent) hook. Here's an example, [from the official docs](https://react.dev/learn/separating-events-from-effects#reading-latest-props-and-state-with-effect-events), that shows how it can be used to log whenever `url` changes, and still access the latest value of `numberOfItems` without needing to resort to `useRef` proxying:\n\n```tsx\n// import {useEffectEvent} from 'react'\nimport {useEffectEvent} from 'use-effect-event'\n\nfunction Page({url}) {\n  const {items} = useContext(ShoppingCartContext)\n  const numberOfItems = items.length\n\n  const onVisit = useEffectEvent((visitedUrl) => {\n    logVisit(visitedUrl, numberOfItems)\n  })\n\n  useEffect(() => {\n    onVisit(url)\n  }, [url])\n}\n```\n\n## Why use this instead of the native hook?\n\n- It works all the way back to React 18.3, while the native hook requires React 19.2.\n- React 19.2 (the current `react@latest` line) ships the native hook with a bug: inside components wrapped in `React.memo` or `React.forwardRef`, effect events keep reading first-render props and state forever ([facebook/react#34818](https://github.com/facebook/react/issues/34818), fixed by [facebook/react#34831](https://github.com/facebook/react/pull/34831) but only shipped in 19.3 canary/experimental builds so far). This ponyfill doesn't share the bug — its update path (`useInsertionEffect`) runs for every component type. The regression tests in [`test/react-19.2`](test/react-19.2/useEffectEvent.test.tsx) document the native bug side by side with the ponyfill, and [`test/react-experimental`](test/react-experimental/useEffectEvent.test.tsx) verifies the upstream fix in experimental builds.\n\n## Function identity\n\nThe ponyfill deliberately differs from the native hook in one way: **the returned function has a stable identity** — you get the same function on every render, like a `useCallback` with no dependencies that can never grow stale. The native hook returns a new closure on every render.\n\nYou should still omit effect-event functions from dependency arrays (that's the contract both the official linter and this package's docs teach), but with a stable identity nothing breaks when a dependency array includes one anyway — whether a teammate, a codemod, or a linter put it there. This matters in practice because the ecosystem disagrees about that array:\n\n- `eslint-plugin-react-hooks` (stable, v6+) recognizes `useEffectEvent` functions by name — including this ponyfill's — and its `exhaustive-deps` rule **forbids** listing them as dependencies.\n- oxlint's `react-hooks/exhaustive-deps` port behaves the same way.\n- oxlint's compiler-ported `react/exhaustive-effect-dependencies` rule (part of the [React Compiler rules](https://oxc.rs/blog/2026-08-18-react-compiler-support), enabled by its `suspicious` category) only exempts the **native** hook and **requires** this ponyfill's functions in the dependency array — the exact opposite. With an unstable identity that inclusion would re-fire the effect on every render; with a stable identity it's harmless.\n- The React Compiler itself (both `babel-plugin-react-compiler` and the oxc port, which produce identical output for this package) never rewrites your dependency arrays, but it does memoize effect callbacks keyed on the identity of the functions they call — a stable identity means those memo slots actually hit.\n\n## Linting\n\n`eslint-plugin-react-hooks` v6 and later (and oxlint's `react-hooks` rules) understand effect events created by this package out of the box, matched by the `useEffectEvent` name: `rules-of-hooks` checks they aren't passed around or called during render, and `exhaustive-deps` excludes them from dependency arrays. The `eslint-plugin-react-hooks@experimental` install this README used to recommend is no longer needed.\n","readmeFilename":""}