usehooks icon indicating copy to clipboard operation
usehooks copied to clipboard

useInterval: Cannot assign to import "useEffectEvent" using VITE

Open letyassine opened this issue 6 months ago • 1 comments

X [ERROR] Cannot assign to import "useEffectEvent"

node_modules/@uidotdev/usehooks/index.js:3:6:
  3 │ React.useEffectEvent = React.experimental_useEffectEvent;
    ╵       ~~~~~~~~~~~~~~

Imports are immutable in JavaScript. To modify the value of this import, you must export a setter
function in the imported file (e.g. "setUseEffectEvent") and then import and call that function here instead.

letyassine avatar Jul 01 '25 12:07 letyassine

You're probably using React 19, as useEffectEvent has been released and is no longer an experimental feature. This package could be updated to support some of the experimental features from the experimental branch.

JoffrayBillon avatar Dec 11 '25 14:12 JoffrayBillon