the element. In this case, it waits for the exit animation to finish.</p>
<p>We can verify that both the enter and exit animations work by mounting the <code>Toggler</code> component:</p>
<pre><code class="lang-javascript">m.mount(document.body, Toggler)
</code></pre>
<p>Note that the <code>onbeforeremove</code> hook only fires on the element that loses its <code>parentNode</code> when an element gets detached from the DOM. This behavior is by design and exists to prevent a potential jarring user experience