Skip to content

Prepare for react async rendering #10

Description

@daviderenger

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions