Loop in react-native

前端 未结 6 1639
慢半拍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 00:45

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

提交回复
热议问题