title: React form using Axios post
body: <p>I've been searching the internet for days and cannot seem to find anything related to submitting a form request through React and using Axios post to input the information to our REST API. Every time we submit our register form every value comes up undefined. Is this the best way to have React communicate with our REST API? Also we have tested the API using Postman and know it's working.</p>
  
  <pre><code>var React = require('react');
  
  var Access = React.createClass({
      getInitialState: function() {
          return {
              firstName: '',
              lastName: '',
              email: '',
              password1: ''
          }
      },
  
      handleSubmit: function(e) {
          var _this = this;
          this.serverRequest = axios
          console.log(_this.ref.firstName)
          .post("/api/Users", {
              userFirstName: _this.ref.firstName,
              userLastName: _this.ref.lastName,
              userEmail: _this.ref.email,
              userPassword: _this.ref.password1
          })
          .then(function(response) {
              console.log(response);
          }) .catch(function (error) {
              console.log(error);
          });
      },
  
      render: function() {
          return(
              &lt;div&gt;
                  &lt;section className="access"&gt;
                      &lt;div className="row center-xs container"&gt;
                          &lt;div className="col-xs-12 col-sm-4 sign-in"&gt;
                              &lt;h1&gt;Sign-In&lt;/h1&gt;
                              &lt;form action="/" method="get"&gt;
                                  &lt;label htmlFor="email"&gt;Email&lt;/label&gt;
                                  &lt;input type="email" name="email" placeholder="Email"/&gt;
                                  &lt;label htmlFor="password"&gt;Password&lt;/label&gt;
                                  &lt;input type="password" name="password" placeholder="Password"/&gt;
                                  &lt;input className="button pink" type="submit" value="Sign-In"/&gt;
                                  &lt;br/&gt;
                                  &lt;input type="checkbox" name="RememberMe"/&gt;
                                  &lt;label htmlFor="RememberMe"&gt;Remember me&lt;/label&gt;
                                  &lt;span&gt; | &lt;a href="/"&gt;Forgot password?&lt;/a&gt;&lt;/span&gt;
                              &lt;/form&gt;
                          &lt;/div&gt;
                          &lt;div className="col-xs-12 col-sm-4 register"&gt;
                              &lt;h1&gt;Register&lt;/h1&gt;
                              &lt;form onSubmit={this.onSubmit}&gt;
                                  &lt;label htmlFor="firstName"&gt;First Name&lt;/label&gt;
                                  &lt;input type="text" name="firstName" placeholder="First Name" ref="firstName"/&gt;
                                  &lt;label htmlFor="lastName"&gt;Last Name&lt;/label&gt;
                                  &lt;input type="text" name="lastName" placeholder="Last Name" ref="lastName"/&gt;
                                  &lt;label htmlFor="email"&gt;Email&lt;/label&gt;
                                  &lt;input type="email" name="email" placeholder="Email" ref="email"/&gt;
                                  &lt;label htmlFor="password1"&gt;Password&lt;/label&gt;
                                  &lt;input type="password" name="password1" placeholder="Password" ref="password1"/&gt;
                                  &lt;label htmlFor="password2"&gt;Re-enter Password&lt;/label&gt;
                                  &lt;input type="password" name="password2" placeholder="Password"/&gt;
                                  &lt;input className="button gold" type="submit" value="Register"/&gt;
                              &lt;/form&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/section&gt;
              &lt;/div&gt;
          );
      }
  });
  
  module.exports = Access;
  </code></pre>