Skip to content

fix(rafz): stop springs ticking twice per frame after the loop goes idle - #2598

Merged
joshuaellis merged 1 commit into
nextfrom
fix/rafz-restart-double-loop
Sep 28, 2026
Merged

joshuaellis merged 1 commit into
nextfrom
fix/rafz-restart-double-loop

Conversation

@joshuaellis

Copy link
Copy Markdown
Member

Why

An animation that starts just after the previous one came to rest now ticks once per frame. Before, it ticked twice until everything settled, so physics springs ran fast and duration springs could report a NaN velocity.

The frame loop books its next frame before it checks for work, so a loop that has just gone idle still has a frame booked. Starting an animation before that frame booked a second one, and both loops kept running.

…rame

The loop books its next frame before checking for work, so a loop that has
just gone idle still has a frame booked. Starting an animation before that
frame booked a second one, and both loops then ticked every job each frame
until everything came to rest. A restart now reuses the booked frame.
@changeset-bot

changeset-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0b8dd3b

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

This PR includes changesets to release 8 packages
Name Type
@react-spring/rafz Patch
@react-spring/animated Patch
@react-spring/core Patch
@react-spring/parallax Patch
@react-spring/shared Patch
@react-spring/types Patch
@react-spring/three Patch
@react-spring/web 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

@joshuaellis
joshuaellis added this pull request to stack #2600 September 28, 2026 13:27
@joshuaellis
joshuaellis merged commit 82d3f9e into next Sep 28, 2026
15 checks passed
@joshuaellis
joshuaellis deleted the fix/rafz-restart-double-loop branch September 28, 2026 13:35
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.

1 participant