Install an event listener when a component is mounted.
Install an event listener when a component is mounted. Automatically uninstalls the event listener when the component is unmounted.
A string representing the event type to listen for.
If true, useCapture indicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events which are bubbling upward through the tree will not trigger a listener designated to use capture.