React Native foreach loop

前端 未结 3 1117
慢半拍i
慢半拍i 2021-02-14 19:09

I\'m developing a little app in React Native and I am looking for something like a foreach function. I just can\'t find a foreach loop. Not on StackOverflow and not even in the

3条回答
  •  [愿得一人]
    2021-02-14 19:43

    In react, preferred way is map method of Array. Example using ES6 arrow function:

    render() {    
        return (
                
               {dataList.map(r => )}    
            
        )
    }
    

提交回复
热议问题