this.setState({ [e.target.name]: e.target.value }) why brackets? 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
+ })
+ }