title: How to use useCallback to operate always on the fresh arguments?
body: <p>What is wrong here?</p>
  <pre><code>    const [numOfRenderInProgress, setNumOfRenderInProgress] = useState&lt;number&gt;(-1)
      
      const decrease = useCallback(() =&gt; {
          setNumOfRenderInProgress(numOfRenderInProgress - 1)
      }, [numOfRenderInProgress])
  
      const draw = (ctx) =&gt; {
          let i = 0
  
          if (imgId1) {
              let i1 = new Image()
              i1.src = `https://${bucket}.s3.eu-central-1.amazonaws.com/${imgId1}`
              i1.crossOrigin = 'anonymous'
              i++
              i1.onload = () =&gt; {
                  ctx.drawImage(i1, 114, -6, 252, 464)
                  decrease()
              }
          }
  </code></pre>
  <p>Calling <code>decrease</code> will not take into account the 'recent' state, but one from call time.</p>