Is it guaranteed that the componentDidMount lifecycle method will always be executed (and complete) before componentWillUnmount?
For example, in my componentDidMount method I am registering a subscription:
componentDidMount() {
this.unsubscribe = subscribe();
}
componentWillUnmount() {
this.unsubscribe();
}
If componentDidMount is not guaranteed to execute and complete before componentWillUnmount then this.unsubscribe is potentially undefined and attempting to invoke it will throw a runtime error.