title: Redirect after enter form react
body: <p>I have a form in react, actually I can make it work with a <strong>submit button.</strong>
  When I click on the submit button, <strong>a Link send me to the desired component.</strong></p>
  
  <p>But when I press "<strong>enter</strong>" after writing something in my input form, like most people do, <strong>nothing happen indeed.</strong></p>
  
  <p>How can I redirect to the results page when someone write something in the form and press enter key?</p>
  
  <p>Here is the form, and his functional component with useState:</p>
  
  <pre><code>
  function Header(){
  
      const [title, setTitle] = useState('');
  
      const handleSubmit = (e) =&gt; {
          e.preventDefault();
          if (!title) return;
          setTitle(title);
          setTitle("");
          console.log(title);
      }
  
      return(
          &lt;nav&gt;
              &lt;li className="liensNav"&gt;
                  &lt;Link className="lien" to="/"&gt;
                      {/* Tu as fill white dans le logo svg */}
                      &lt;img className="logo" src={logo} alt="logo"&gt;&lt;/img&gt;
                  &lt;/Link&gt;
              &lt;/li&gt;
              &lt;li className="liensNav"&gt;
                  &lt;Link className="lien" to="/"&gt;Top Games&lt;/Link&gt;
              &lt;/li&gt;
              &lt;li className="liensNav"&gt;
                  &lt;Link className="lien" to="/top-streams"&gt;Top Live Streams&lt;/Link&gt;
              &lt;/li&gt;
              &lt;li className="liensNav"&gt;
  
                  &lt;form className="formSubmit" onSubmit={handleSubmit}&gt;
  
                      &lt;input className="inputRecherche" type="text" value={title}
                      required onChange={(e) =&gt; setTitle(e.target.value)} /&gt;
  
  
                  &lt;button type="submit"&gt;
                      &lt;Link
                      to={{
                          pathname: "/resultats",
                          state: {
                              id : title
                          }
                      }}
                      &gt;
                          &lt;img className="logoLoupe" src={search} alt="icone loupe"/&gt;
                      &lt;/Link&gt;
                  &lt;/button&gt;
  
  
                  &lt;/form&gt;
  
              &lt;/li&gt;
  
          &lt;/nav&gt;
      )
  }
  export default Header;
  
  </code></pre>
  
  <p>Maybe I need to use <strong>onKeyPress</strong> ? <strong>But anyway I don't know how to redirect on enter, that is the major problem.</strong></p>
  
  <p>Thanks if someone if passing by.</p>