Skip to content

Maybe could use more accurate description of componentWillMount #9304

@NE-SmallTown

Description

@NE-SmallTown

Current doc about componentWillMount says that:

It is called before render(), therefore setting state in this method will not trigger a re-rendering.

I thinks it would be better if we say:

It is called before render(), therefore setting state directly in this method will not trigger a re-rendering because we batch it.(but setting state indirectly/asynchronous will trigger a re-rendering,such as setTimeout(() => {this.setState(...)})).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions