title: I get Cannot GET /[object%20Object] on button click in React
body: <p>I am new to React and learning click events. But the issue I faced is that one button click I get "Cannot GET /[object%20Object]". Here is the code I am using: </p>
  
  <pre><code>class Engine extends React.Component {
    render() {
      let types = ["Diesel", "Gazoline"];
      return (
        &lt;div&gt;
          &lt;Car type={types} /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  class Car extends React.Component {
    open() {
      console.log("You have clicked");
    }
    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;button onClick={open}&gt;Remove all&lt;/button&gt;
        &lt;/div&gt;
      );
    }
  }
  
  const box = document.querySelector(".mir");
  
  ReactDOM.render(&lt;Engine /&gt;, box);
  </code></pre>