1fetch('http://localhost:5000/', {
2 method : 'post',
3 headers :{ 'Content-Type' : 'application/json'},
4 body : JSON.stringify({
5 userId : this.state.userId,
6 password : this.state.password
7 })
8}).then(response => response.json())
9 .then(data => {
10 if(data === 'success'){
11 this.props.onRouteChange('home');
12 }
13})
14