Skip to content

Conversation

@hiebj
Copy link

@hiebj hiebj commented Jan 20, 2026

Why

Fixes #1868

What

When trail and exitBeforeEnter are used together, only the last of the leave transitions was being removed from exitingTransitions. (See useTransition.tsx:330) On re-render, the other transitions which remained in exitingTransitions meant enter animations would not play.

Instead I am now clearing each transition as it completes. Essentially I just moved the delete() statement into the t.phase == TransitionPhase.LEAVE block so that it runs for every leaving transition rather than waiting for idle.

I also added a new test. To verify the fix you can pull this commit, remove the fix, and run the test. It will fail. With the fix in place, it passes. No other tests fail and my visual tests in my app show that things still work.

Checklist

  • Documentation updated
  • Demo added
  • Ready to be merged

I don't think documentation needs to be updated or a demo needs to be added for this bugfix

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2026

🦋 Changeset detected

Latest commit: 61a9853

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-spring/core Patch
@react-spring/animated Patch
@react-spring/parallax Patch
@react-spring/rafz Patch
@react-spring/shared Patch
@react-spring/types Patch
@react-spring/konva Patch
@react-spring/native Patch
@react-spring/three Patch
@react-spring/web Patch
@react-spring/zdog Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
react-spring Ready Ready Preview Jan 23, 2026 6:10am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: exitBeforeEnter in useTransition doesn't work when used with trail

1 participant