setstate sebelum fungsi bereaksi

this.setState(
  {newState: 'whatever'},
  () => {/*do something after the state has been updated*/}
)
Xenophobic Xenomorph