title: How to update a single property of the state in a react hook?
body: <p>I'm trying to change a state hook and I got this error... I know another way to change but it should work with the spread syntax, right?</p>
  
  <pre class="lang-js prettyprint-override"><code>export default function App() {
    const [state, setState] = {
      sld_url: "",
      geojson_url: "",
    }
  
    const handleSldUrlChange = event =&gt; {
      setState({...state, sld_url: event.target.value})
    }
  
    return (
      &lt;TextField
       label="SLD URL"
       value={state.sld_url}
       className={classes.textField}
       onChange={handleSldUrlChange}
       margin="normal"
       variant="outlined"
      /&gt;
    );
  }
  </code></pre>