title: Add value from input into array is not working in React
body: <p>I am new to React and wanted to add value from input into array but nothing happens when I try to achieve that. GUYS IF SOMETHING IS NOT CLEAR PLEASE LET ME KNOW. Here is the code I am using:</p>
  
  <pre><code>class Engine extends React.Component {
    render() {
      let types = ["Diesel", "Gazoline", "Simple"];
      return (
        &lt;div&gt;
          &lt;Car type={types} /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  class Car extends React.Component {
    openm(e) {
      let addItem = e.target.elements.type.value;
  
      if (addItem) {
        this.props.type.push(additem);
      }
    }
  
    render() {
      return (
        &lt;div&gt;
          &lt;h1&gt;
            {this.props.type.map((item, index) =&gt; {
              return &lt;p key={index}&gt;{item}&lt;/p&gt;;
            })}
          &lt;/h1&gt;
          &lt;form onSubmit={this.openm}&gt;
            &lt;input type="text" name="type" /&gt;
            &lt;button&gt;Remo all&lt;/button&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      );
    }
  }
  
  const box = document.querySelector(".mir");
  
  ReactDOM.render(&lt;Engine /&gt;, box);
  </code></pre>
  
  <p>If you look at the code in Car class's openm method, I am trying to get access to array via props. </p>