Render Content Dynamically from an array map function in React Native

前端 未结 3 1526
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 01:48

I\'m trying to get data from an array and using map function to render content. Look at

**{this.lapsList()}** 

and the associated

3条回答
  •  鱼传尺愫
    2020-12-09 02:21

    Try moving the lapsList function out of your class and into your render function:

    render() {
      const lapsList = this.state.laps.map((data) => {
        return (
          {data.time}
        )
      })
    
      return (
        
          
            coucou test
            {lapsList}
          
        
      )
    }
    

提交回复
热议问题