0 points

A correct way to log the current state after the update would be:


dashboard

Thu Oct 15 2020 07:52:45 GMT+0000 (UTC)

Posted by @papiproud #react.js #setstate

this.setState({ name: 'Matt' }, () => console.log(this.state.name))
content_copy Copy

https://dev.to/thawkin3/3-react-mistakes-junior-developers-make-with-component-state-1bhd?utm_source