title: How to handle the `onKeyPress` event in ReactJS?
body: <p>How can I make the <code>onKeyPress</code> event work in ReactJS? It should alert when <strong><code>enter (keyCode=13)</code></strong> is pressed.</p>
  
  <pre><code>var Test = React.createClass({
      add: function(event){
          if(event.keyCode == 13){
              alert('Adding....');
          }
      },
      render: function(){
          return(
              &lt;div&gt;
                  &lt;input type="text" id="one" onKeyPress={this.add} /&gt;    
              &lt;/div&gt;
          );
      }
  });
  
  React.render(&lt;Test /&gt;, document.body);
  </code></pre>