title: How to call function after setState updated(callback)
body: <p>I want to setVoting before setVote then run sendVote. However anyway it run sendVote first. How can i solve it? I use React Hook... so it is difficult. Please help me!!! Thank you so much.</p>
  <pre><code>    &lt;TouchableOpacity onPress={() =&gt; {setVoting(!voting); setVote(voting?vote-1:vote+1); sendVote();}}&gt;
         &lt;Ionicons 
          name= {voting?'md-star':'md-star-outline'}
          size={24} 
          color={'#aa4fff'} 
         /&gt;
      &lt;/TouchableOpacity&gt;
  </code></pre>