title: (REACT) HowTo Create Dynamic Select Option List from Array
body: <p>So, I wish to create, what the end result would be is, a dynamically built select options list in a .js file, generated from an array list, as depicted between the 'options' part of the code below. How do I do this?:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>const kvArray = [
    {children: 'Country List', value: 0}, 
    {children: 'France', value: 10}, 
    {children: 'England', value: 20}, 
    {children: 'Peru', value: 30}
  ].map ((keySelect, index) =&gt; ({
    id: index,
    name: keySelect,
  }));
  
  class FieldsPage extends React.Component {
  
    onFormSubmit = () =&gt; {
      const { dynamicFields, fields } = this.props;
  
      const values = {
        ...fields.$values(),
        concepts: {
          ...dynamicFields,
        },
      };
    }
  
    render() {
      const { fields } = this.props;
      const { disabled, error, submittedValues, selectValue } = this.state;
      
      return (
        &lt;View&gt;
          &lt;Form onSubmit={this.onFormSubmit}&gt;
            &lt;Block&gt;
              &lt;Select
                {...fields.donation}
                disabled={disabled}
                label="Donation"
                options={[
                  // What I want to happen here: build selection options by iterating through item, i.e.
                  {kvArray.map(item =&gt;
                      { children: item.name.children, value: item.name.value},
                  )}
  
                ]}
              /&gt;
            &lt;/Block&gt;
            &lt;Button disabled={disabled} type="submit"&gt;
              &lt;FormattedMessage {...buttonsMessages.submit} /&gt;
            &lt;/Button&gt;
  
          &lt;/Form&gt;
        &lt;/View&gt;
      );
    }
  
  }</code></pre>
  </div>
  </div>
  </p>