Render array of inputs in react

后端 未结 3 2135
孤独总比滥情好
孤独总比滥情好 2021-02-19 08:04

I have an array of emails (as a part of a bigger model). These are displayed in seperate rows witha remove button for each (the address itself can be updated in the input box d

3条回答
  •  没有蜡笔的小新
    2021-02-19 08:24

    I believe what you're looking for is something like this:

    MyPage = React.createClass({
      mixins: [ReactMeteorData],
    
      getMeteorData() {
        // ...
      },
    
      render() {
        const emails = this.data.emailGroup.emails.map((email) => {
          return (
            
    ); }); return
    {emails}
    } });

    I changed self to this. Since you're using the ES6 arrow function, there's no need to assign self = this.

提交回复
热议问题