Closed bhgsbatista closed 5 years ago
Replaced reference of this.state inside setState with function that takes prevState as parameter because this pattern avoids some nasty issues like:
this.state
this.setState({ items: this.state.items.concat('lorem') }); // items will not have 'lorem' here, oops this.setState({ items: this.state.items.concat('ipsum') });
Replaced reference of
this.state
inside setState with function that takes prevState as parameter because this pattern avoids some nasty issues like: