Hello,
There is "componentWillUnmount" that helps to finish things.
But, we need a kind of "componentLeavedScreen" or a property in "this.props."
For instance, when you play a video via the Plyr component, you can notice that the component plays the video even when you switch to another screen.