title: ReactJS setState with multidimensional object and dynamic key
body: <p>My State is as follows:</p>
  
  <pre><code>this.state = {
    Form: {},
    Result: {
      Duplicate: false,
      ServerError: false
    }
  };
  </code></pre>
  
  <p>I want to dynamically add to the <code>Form</code> object with field values as they're entered, so I try the standard way to add dynamic keys:</p>
  
  <pre><code>handleChange(event) {
    const target = event.target;
    const value = target.type === 'checkbox' ? target.checked : target.value;
    const name = target.name;
    this.setState({
      Form[name]: value
    });
  }
  </code></pre>
  
  <p>But this produces this syntax error:</p>
  
  <pre><code>  66 |         const name = target.name;
    67 |         this.setState({
  &gt; 68 |             Form[name]: value
       |                 ^
    69 |         });
    70 |         console.log(this.state)
    71 |     }
  </code></pre>
  
  <p>Is there another way to achieve this?</p>