Rendering an array.map() in React

前端 未结 9 1947
渐次进展
渐次进展 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 11:49

    You are implicitly returning undefined. You need to return the element.

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

提交回复
热议问题