-
Notifications
You must be signed in to change notification settings - Fork 50.6k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
Noticed this while writing docs:
<ViewTransition
onEnter={(instance) => {
const anim = instance.new.animate(/* ... */);
return () => {
anim.cancel();
};
}}
onExit={(instance) => {
const anim = instance.new.animate(/* ... */);
return () => {
anim.cancel();
};
}}
>
{/* ... */}
</ViewTransition>If you have a pendingonEnter animation and the tree is unmounted, the onEnter cleanup is called immediately.
But if you have a pending onExit and the tree is unmounted, the onExit cleanup isn't called until the animation completes.
This means you can't cancel the animation:
Screen.Recording.2026-02-21.at.11.11.57.AM.mov
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug