Skip to content
zenui/react-hooks

useEvent

Attach an event listener to the window, the document, an element or a ref, and remove it on unmount. The listener can change on every render without re-subscribing.

Level
Intermediate
Since
v1.0.0
import {useEvent} from '@zenuilabs/react-hooks';
Loading demo_

More in Events & DOM