js [event.target.name] why it is in square braket code example
Example: react event target square brackets
handleChange(event) {
+ this.setState({
+ [event.target.name]: event.target.value
+ })
+ }
handleChange(event) {
+ this.setState({
+ [event.target.name]: event.target.value
+ })
+ }