Rendering an array.map() in React

前端 未结 9 1930
渐次进展
渐次进展 2020-12-04 11:17

I am having a problem where I am trying to use array of data to render a

    element. In the code below the console.log\'s are working fine,
9条回答
  •  庸人自扰
    2020-12-04 12:11

    You are not returning. Change to

    this.state.data.map(function(item, i){
      console.log('test');
      return 
  • Test
  • ; })

提交回复
热议问题