Trying to set the state with randomly generated values in `componentDidMount` doesn't seem to update the state immediately. Anyway around this?

后端 未结 0 1894
心在旅途
心在旅途 2021-01-20 16:58

Why am I not able to both set the state and use it immediately afterwards, within componentDidMount?

  componentDidMount() {
    this.setState({
         


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