Size
0.19 kb
useEventHandler
Stabilize a function's reference across renders. The function is always up to date in effects and DOM events.
Deprecated
For React 19.2.0+, use the built-in useEffectEvent hook instead.
Installation
Usage
Provide a function to useEventHandler:
onData now has a stable identity, making it safe to use in useEffect.