Loop in react-native

前端 未结 6 1647
慢半拍i
慢半拍i 2021-02-04 23:57

I want to make a list of fields depending on the number of the player that user has selected. I wanted to make something like this:

generatePaymentField() {
             


        
6条回答
  •  长情又很酷
    2021-02-05 01:03

     render() {
        var myloop = [];
    
        for (let i = 0; i < 10; i++) {
          myloop.push(
            
            {i}
            
          );
        }
    
         return (
    
                
                  Welcome to React Native!
                   {myloop}
                
    
    
            );
          }
    

    Output 1 2 3 4 5 6 7 8 9

提交回复
热议问题