react jsx 数组变量的写法

1.通过 map 方法

var students = ["张三然","李慧思","赵思然","孙力气","王萌萌"];  
              
ReactDOM.render(  
  <ul>  
    {  
      students.map(function(username){  
        return <li>{username}</li>  
      })  
    }  
  </ul>,  
  document.getElementById("root")  
)

.

原文地址:https://www.cnblogs.com/crazycode2/p/9022905.html