Skip to content

setState #13

Open
Open
@blocka

Description

Current behavior is a naive conversion between this.setState and this.*.
setState is more complicated then this, however.

  1. It takes a second argument which is a callback when the setState has been applied.
  2. It can take a function which takes the previous and current props and returns the next state.

Also in general the semantics are not 100% similar. If I'm not mistaken, this.setState doesn't even mutate the state right away, while obviously this.* does, just that the DOM updates get batched. I have no idea if this difference will be a cause of bugs...I guess time and lot's of testing will tell.

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