I see a lot of code like this:
componentDidMount() {
// add event listener
}
componentWillUnmount() {
// remove event listener
}
I understand if the listener is set on something global like window, but if it's just on an HTML element within the component that's about to be unmounted, won't the listener disappear with the component anyway?