What I'm confused about is the [event.target.name]: event.target.value in the argument for setState. I haven't seen this square bracket notation in Javascript before so I don't understand exactly why there's square brackets around the key.
onChange = event => {
this.setState({ [event.target.name]: event.target.value })
};
Not sure what Javascript construct I'm not understanding/missing here.