I\'m learning React and I have Eslint installed in my project. It started giving me errors like
Use callback in setState when referencing the previous state. (r
This is problem with your onChange method. Try something like this:
onChange
onChange = e => this.setState(prevState => ({ data: { ...prevState.data, [e.target.name]: e.target.value } }));
And look at section "State Updates May Be Asynchronous" from https://reactjs.org/docs/state-and-lifecycle.html