title: React: Event handler method for Backspace
body: <p>I am trying to handle an event when the user presses the Backspace button.</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/4690330/jquery-keypress-backspace-wont-fire">this</a>, and I guess I can find Backspace key code using </p>
  
  <p><code>console.log("Did you delete it? " + e.keyCode);</code></p>
  
  <p>but the value of <code>e.keyCode</code> is undefined.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>define(["react"], (React) =&gt; {
    var TypingContainer = React.createClass({
      keypressed(e) {
        console.log("Did you delete it? " + e.keyCode);
      },
  
      handleChange: function(e) {
        // if (e.keycode == 8)
          console.log("Did you delete it? " + e.keyCode);
      },
  
      render: function() {
        return (
           &lt;div&gt;
              &lt;input
                className="typing-container"
                value={this.state.message}
                onChange={this.handleChange}
                onKeyPress={this.keypressed}
              /&gt;
           &lt;/div&gt;
        );
      }
    })
  
    return TypingContainer;
  });
  </code></pre>
  
  <p>Update: With the <code>onKeyPress</code> event, I always get 0.</p>