Skip to content

Suggestion: combine two setState calls into one #11

@tomduggan85

Description

@tomduggan85

this.setState({latitude: position.coords.latitude})

There are two setState calls in a row, that could be combined into one:
this.setState({ latitude: position.coords.latitude, longitude: position.coords.longitude })

Depending on how React batches the setState calls, two setState calls could result in render() being called twice in a row, so having them combined into one would be more efficient in that case.

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