Exercise 03, task 1.
In the onNameChange(event) function you take an event and is supposed to use that event to update the state.
The working solutions, for the tests, is to explicitly name the key, ie: this.setState({name: event.target.value});
But, if you want to be more general, and you don't want to explicitly say that it's the "name" attribute that should always be updated, you can do this:
onNameChange(event){
let obj = {};
obj[event.target.name] = event.target.value;
this.setState(obj);
}
Which works great in the browser, but fails in the tests.
Is there a specific reason for this that I'm missing?