How to solve a problem with setState (React Native)

后端 未结 0 1582
醉酒成梦
醉酒成梦 2020-12-02 18:03

this is my code

state = {
  test: 1,
};

buttonOne = () => {
  this.setState({test: 2})
};

buttonTwo = () => {
  console.log(this.state.test); //1 (I w         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题