title: React js Execute function on submit
body: <p>I have a simple search box on my react app. The box should let the user input a phrase, and then execute another <code>react.js</code> function when they hit the enter key. I have tried every combination (put box in a form, not in a form, <code>onSubmit</code>, etc), but I can't seem to stop the page from "reloading" when the user inputs the information and presses enter.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input className="input" placeholder="Type it Here..." type="text" name="key" id="searchgrid" /&gt;
  </code></pre>
  
  <p>React JS Code:</p>
  
  <pre><code>searchForMatches(){
      var value = document.getElementById("searchgrid").value;
      console.log(value);
  }
  </code></pre>
  
  <p>I just need the <code>searchForMatches()</code> function to run when the user types the enter key into the search box.</p>
  
  <p>Thanks.</p>