Replies: 1 comment 4 replies
-
|
You're welcome to try it, we ran into some difficulties with the real one #9590 I'll try to get a more precise answer of what this meant:
However, if we don't have a stable function returned, I'm not sure how we'd keep our effects from calling stale functions in the closure. We aren't react, so we don't have access to internals. We would be dependent on our effects updating in order to call the most recent function. This negates the benefit of what useEffectEvent is supposed to be for, which is not causing the effect to run ever render and always being up to date regardless. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
According to what the React docs claim,
useEffectEventintentionally returns a different reference on every render — see the note here. Maybe thisuseCallbackshould be removed?Beta Was this translation helpful? Give feedback.
All reactions