title: onClick vs onSubmit in React
body: <p>I have a simple input in react that won't work with <code>onSubmit</code> but with <code>onClick</code>. Why is that? Here is the <a href="https://codesandbox.io/s/8lqoryxj5j" rel="nofollow noreferrer">link</a> to an example.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const styles = {
    fontFamily: 'sans-serif',
    textAlign: 'center',
  };
  
  const clicked = e =&gt; {
    alert("Hi")
  }
  const App = () =&gt; (
    &lt;div style={styles}&gt;
      &lt;input type='submit' value='click' onSubmit={clicked}/&gt;
    &lt;/div&gt;
  );
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById('root'));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"&gt;&lt;/script&gt;
  &lt;div id="root" /&gt;</code></pre>
  </div>
  </div>
  </p>