title: "Parsing error: The type cast expression is expected to be wrapped with parenthesis" with React Hooks
body: <p>I have many inputs which the values matches properties of an object :</p>
  
  <p><strong>Example</strong> :</p>
  
  <pre><code>const [fields, setFields] = useState({
    city: ""
  })
  &lt;input type="text" name="city" value={fields.city} onChange={e =&gt; handleChange(e) /&gt;
  </code></pre>
  
  <p>Now, I want to do a handleChange function which updates the object values, when the input value changes,</p>
  
  <pre><code>function handleChange(e) {
    setFields(...fields, [e.target.name]: e.target.value)
  }
  </code></pre>
  
  <p>but when I do this, I got the error </p>
  
  <blockquote>
    <p>"Parsing error: The type cast expression is expected to be wrapped
    with parenthesis"</p>
  </blockquote>
  
  <p>,</p>
  
  <p>Can someone help me ? Thank you !</p>