Uncaught TypeError: this.state.data.map is not a function

后端 未结 5 1795
無奈伤痛
無奈伤痛 2020-12-15 18:06

I am new to React, have seen some of the similar issues, but didn’t find why this happens. I am getting an “Uncaught TypeError: this.state.data.map is not a function”. Here

5条回答
  •  离开以前
    2020-12-15 18:42

    If your data is a string type then instead you must use this.state.data.split('').map(ch=>{ console.log('Hello from map') })

提交回复
热议问题