React hook equivalent to callback function after setting state : <p>In react (before hooks) when we set state we could call a function after state had been set as such:</p>

<pre><code>this.setState({}, () =&gt; {//Callback})
</code></pre>

<p>What is the equivalent of this with hooks?</p>

<p>I tried doing this </p>

<pre><code>const [currentRange, setCurrentRange] = useState("24h");

setCurrentRange(someRange, () =&gt; console.log('hi')) 

</code></pre>

<p>But this did not work</p>

<p>Anyone know a solution for this?</p>
