I am trying to insert form data from reactJS to mysql database on Node.js. I am beginner in reactJS so please help me.

```
import React from 'react';
import Layout from './App.jsx';

class Header extends React.Component{

constructor(props) {
  super(props);
  this.handleSubmit = this.handleSubmit.bind(this);
}

handleSubmit(event) {
 var fname=this.refs.fname.value; //This variable holds firstname 
}
render() {
  return (
    <div>
      <form onSubmit={this.handleSubmit}>
      <h1>Registration Form: </h1>
      <label>
       First Name:
       <input type="text" ref="fname" value={this.state.fname}  /><br/><br/>
      </label><br/>
      <label>
       Last Name:
       <input type="text" ref="lname" value={this.state.lname}  /><br/><br/>
      </label><br/>
    <input type="submit" value="Submit" />      
  </form>
 </div> 
);
 }
}
export default Header;

```

Above code is `Header.jsx` which renders form

The variable `fname` contains value which I want to insert into mysql database.