use-event-listener
Subscribes to events with a ref
Import
Source
Docs
Package
Usage
use-event-listener
adds a given event listener to an element to which ref
is assigned.
Hook supports the same options as addEventListener
method.
After the component is unmounted, the listener is automatically removed.