title: React TypeScript onSubmit e.preventDefault() not working
body: <p>I'm building a simple user search app using React and TypeScript. I have a basic form with an input text box to search users and an input button that submits the search. But the <code>e.preventDefault()</code> method in my <code>onSubmit</code> method doesn't seem to be working. When I submit, the whole app refreshes. Actually, it may be that <code>onSubmit</code> isn't even being called at all.</p>
  
  <pre class="lang-js prettyprint-override"><code>  private handleSubmit = (e: React.FormEvent&lt;HTMLInputElement&gt;) =&gt; {
      e.preventDefault();
      this.props.searchUsers(this.state.text);
      this.setState({text: ''});
    }
  
    private handleChange = (e: React.FormEvent&lt;HTMLInputElement&gt;) =&gt; {
      this.setState({text: e.currentTarget.value});
    }
  
    public render() {
      return (
        &lt;div&gt;
          &lt;form className="form"&gt;
            &lt;input 
              type="text" 
              name="text" 
              value={this.state.text} 
              placeholder="Search Users..."
              onChange={this.handleChange}
            /&gt;
            &lt;input 
              type="submit"
              value="search"
              className="btn btn-dark btn-block" 
              onSubmit={this.handleSubmit}
            /&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      );
    }
  </code></pre>
  
  <p>Any suggestions? Thanks!</p>