title: How to import two input name into an array in react
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class BankForm extends Component {
     constructor() {
       super();
       this.onSubmit = this.onSubmit.bind(this);
     }
  
     onSubmit(e) {
       e.preventDefault();
       console.log(e.target.price.value);
     }
  
     render() {
        return (
          &lt;AddForm onSubmit={this.onSubmit} /&gt;
        );
     }
  }
  
  function AddForm(props) {
     return (
        &lt;div&gt;
          &lt;form onSubmit={props.onSubmit}&gt;
             &lt;input type="number" name="price" /&gt;
             &lt;input type="number" name="price" /&gt;
             &lt;button type="submit"&gt;Submit&lt;/button&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      );
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>How to import two input name into an array in react</p>
  
  <p>Please fix my code in console.log(e.target.price.value);</p>
  
  <p>I tried it :</p>
  
  <p>console.log(e.target.price.value[0]); x</p>
  
  <p>console.log(e.target.price[0].value); x</p>
  
  <p>This code will work well if there is only one price.</p>
  
  <p>Help me!!! :C</p>