FormidableLabs / freactal

Clean and robust state management for React and React-like libs.
MIT License
1.65k stars 46 forks source link

Error in provide when `componentWillUnmount` called without `componentDidMount` #40

Closed markacola closed 7 years ago

markacola commented 7 years ago

If there is an error thrown in a child render method under provide then componentDidMount won't fire before componentWillUnmount, causing this.unsubscribe to be undefined.

When componentWillUnmount is called to unmount the partial tree this.unsubscribe is called, resulting in TypeError: this.unsubscribe is not a function at StatefulComponent.componentWillUnmount. This masks the actual error being thrown in the child render method, making it difficult to debug in development.