<p dir="auto">Maybe I am overlooking something, but <code class="notranslate">useMount</code> and <code class="notranslate">useUpdate</code> seem to be useful.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Ignore didMount. Behave like didUpdate. This should be part of React imho.
const didMountRef = useRef(false);
useEffect(() =&gt; {
  if (!didMountRef.current) {
    didMountRef.current = true;
    return;
  }
  saveDraftWebThrottled(document);
}, [document, saveDraftWebThrottled]);"><pre class="notranslate"><span class="pl-c">// Ignore didMount. Behave like didUpdate. This should be part of React imho.</span>
<span class="pl-k">const</span> <span class="pl-s1">didMountRef</span> <span class="pl-c1">=</span> <span class="pl-en">useRef</span><span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">useEffect</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">didMountRef</span><span class="pl-kos">.</span><span class="pl-c1">current</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">didMountRef</span><span class="pl-kos">.</span><span class="pl-c1">current</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
  <span class="pl-en">saveDraftWebThrottled</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-smi">document</span><span class="pl-kos">,</span> <span class="pl-s1">saveDraftWebThrottled</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><a href="https://github.com/facebook/react/blob/v17.0.2/packages/react/package.json#L7">version</a><br>
React version:</p>
<p dir="auto">why react version in tag v17.0.2 is 17.0.0, Which commit is the source code of version 17.0.2 react</p>
<h2 dir="auto">Steps To Reproduce</h2>
<ol dir="auto">
<li></li>
<li></li>
</ol>

<p dir="auto">Link to code example:</p>

<h2 dir="auto">The current behavior</h2>
<h2 dir="auto">The expected behavior</h2>