react中的map遍历

  constructor(props) {
    super(props);
    this.state = {
      list:[
        'learn react',
        'learn english'
      ]
    }
  }
  render() {
    //jsx语法
    return (
      
    { this.state.list.map((item,key) =>{ return
  • {item}
  • }) }
); }

 

你可能感兴趣的:(React)