Skip to content

React 19: add support for useEffectEvent hook#51

Open
shsr04 wants to merge 1 commit into
betula:masterfrom
shsr04:use-effect-event
Open

React 19: add support for useEffectEvent hook#51
shsr04 wants to merge 1 commit into
betula:masterfrom
shsr04:use-effect-event

Conversation

@shsr04
Copy link
Copy Markdown
Contributor

@shsr04 shsr04 commented Apr 17, 2026

This MR provides support for the new React 19 hook useEffectEvent.

This is a useful hook when you want to ignore "non-reactive" callbacks from effect dependencies.

After some npm dependency hacking, I got it to work locally and also added a unit test.

Note the particular design of useEffectEvent, which I have reproduced in this implementation:

Effect Event functions do not have a stable identity. Their identity intentionally changes on every render.

Let me know what you think 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant