forked from gaperton/React-MVx
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
React 16.3 introduce some new lifecycle hooks and they will deprecate some of the old one in the next release. Also they are very clear with that the constructor, componentWillMount and some others must be side effect free.
http://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/
Currently in MVx uses the constructor and componentWillMount for setting up stuff, like state and starts listen to props. That will lead to leaks later on when react decides to cancel a job and never mount the component at all (componentWillUnmount will never be called). React suggests that all code that add listeners that is supposed to be cleaned out in componentWillUnmount should be added in componentDidMount.
gaperton