title: Adding a link to a key press event
body: <p>I would like to add a react-router Link to a key press event in a form that I am creating. The form itself looks like this:</p>
  
  <pre><code>&lt;div className="col-md-6 col-md-offset-3" onKeyPress={e =&gt; this._handleKeyPress(e)}&gt;
      &lt;Paper style={styles.form}&gt;
          &lt;form role="form"&gt;
              &lt;div className="text-center"&gt;
                  &lt;h2&gt;Enter Your Details to Login&lt;/h2&gt;
                  &lt;div className="col-md-12"&gt;
                      &lt;TextField
                          hintText="Email"
                          floatingLabelText="Email"
                          type="email"
                          errorText={this.state.email_error_text}
                          onChange={e =&gt; this.changeValue(e, 'email')}
                          onBlur={this.isDisabled} 
                      /&gt;
                  &lt;/div&gt;
                  &lt;div className="col-md-12"&gt;
                      &lt;TextField
                          hintText="Password"
                          floatingLabelText="Password"
                          type="password"
                          errorText={this.state.password_error_text}
                          onChange={e =&gt; this.changeValue(e, 'password')}
                          onBlur={this.isDisabled} 
                      /&gt;
                  &lt;/div&gt;
                  &lt;FlatButton
                      containerElement={&lt;Link to="/portal" /&gt;}
                      disabled={this.state.disabled}
                      style={{"marginTop": 50}}
                      label="Submit"
                      onClick={e =&gt; this.login(e)} 
                  /&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/Paper&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can see I am making the material-ui button a link to the next page. However, I would also like to do something similar when the enter key is pressed to submit the form. At the moment I have this to handle the key event and the login:</p>
  
  <pre><code>_handleKeyPress(e) {
      if (e.key === 'Enter') {
          if (!this.state.disabled) {
              this.login(e);
          }
      }
  }
  
  login(e) {
      createUser(this.state.email, this.state.password);
  }
  </code></pre>
  
  <p>But as you can see there is no transition occurring in the key press function.</p>
  
  <p>My question is how can I go about adding this to the key press event so that it will also cause a transition to the next page?</p>
  
  <p>Any help would be very much appreciated, as always.</p>
  
  <p>Thanks for your time</p>