use-between
use-between copied to clipboard
React 19: add support for useEffectEvent hook
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 😎