How to make a request to the server React?

There is a form where the entered data(name, surname, etc). How to send the data to the server in Reacte?

class App extends React.Component {
 constructor() {
super();
 this.state = {value: "};
}

 handleChange(event) {
 this.setState({value: event.target.value});
}

 handleSubmit(event) {
 alert(this.state.value); 
 event.preventDefault(); 
}

 render() {
 return <form onsubmit="{this.handleSubmit.bind(this)}">
<label>
Name:
 <input value="{this.state.value}" onchange="{this.handleChange.bind(this)}">
</label>
 <input type="submit">
</form>
}
}
June 7th 19 at 15:00
2 answers
June 7th 19 at 15:02
Solution
in function handleSubmit using fetch or post to axios stick with your data on the server
Thank you) - Jaylen commented on June 7th 19 at 15:05
not for what
good luck - Raquel.Labad commented on June 7th 19 at 15:08
June 7th 19 at 15:04

Find more questions by tags React