Objects are not valid as a React child

前端 未结 3 652
轻奢々
轻奢々 2020-12-03 02:26

I am getting an below error. I can see that I have to return array instead of object. But I am really not sure how to fix it. Thanks in advance

Object

3条回答
  •  余生分开走
    2020-12-03 03:00

    timeElapsed is an object, React doesn't know how to render this:

      
        {this.state.timeElapsed}
      
    

    Try changing this.state.timeElapsed for a string like for example:

      
        {this.state.timeElapsed.toString()}
      
    

提交回复
热议问题