I have a React component that creates an event listener, and displays a list of links. Once the user clicks on a link the componentWillUnmount method is called and a new page displayed. My component continues to function and handle events after it has been unmounted. This works as intended as I am keeping track of whether my control is mounted or not and calling functions passed in through props based on the mounted/unmounted state.
Everything seems to be working fine, but I've read in the React docs, "componentWillUnmount() is invoked immediately before a component is unmounted and destroyed". I am also aware that isMounted is an anti-pattern so I am keeping track of whether the control is mounted myself. Is it just a matter of time before my component is destroyed or is my event listener keeping it from being destroyed?