title: What's the react hooks equivalent of the following snippet?
body: <p>I'm trying to convert the following setState function to React Hooks</p>
  <pre><code>const setUserAnswer = (answer) =&gt; {
       this.setState((state) =&gt; ({
         answersCount: {
           ...state.answersCount,
           [answer]: (state.answersCount[answer] || 0) + 1
         },
         answer: answer
       }));
  </code></pre>