Is it allowed to assign a single variable of react component state like this.state.foo = "bar"
without calling setState? I need to change part of the state in multiple places, and I'm unable to use object spread operator and Object.assign is too verbose. How to change just a part of the state without redefining the whole state?
Aucun commentaire:
Enregistrer un commentaire