Uses an effect to add event listeners to a target when the component mounts, and remove them when the component unmounts.
The type of the target, which must extend EventTarget.
The target to add event listeners to.
The event handlers to add to the target.
The dependencies of the effect. The effect will run again if these dependencies change.
Uses an effect to add event listeners to a target when the component mounts, and remove them when the component unmounts.