ReactJS - prevState in the new useState React hook? : <p>I really like the new <a href="https://reactjs.org/docs/hooks-state.html" rel="noreferrer">React hooks</a> and I'm using them frequently for a project I'm working on. I'm coming across a situation where I want to use the <em>prevState</em> in the <code>useState</code> hook, but I'm not really certain on how to do this.</p>

<p>I've tried something like this, but it fails to compile.</p>

<pre><code>const [ someState, setSomeState ] = useState( new Map() )
setSomeState( prevState.someState.set( key, value ) )
</code></pre>

<p>(by the way, this is to map an array of checkboxes to keep track of the ones that are check marked)</p>

<p>I'm trying to follow this example <a href="https://medium.com/@wlodarczyk_j/handling-multiple-checkboxes-in-react-js-337863fd284e" rel="noreferrer">here</a>, but without using the <code>setState</code> function.</p>

<p>Thanks for the help!</p>
