Skip to content

test(core): cover declarative useSpring auto-start under StrictMode (#2361)#2531

Merged
joshuaellis merged 1 commit into
nextfrom
test/2361
Jun 9, 2026
Merged

test(core): cover declarative useSpring auto-start under StrictMode (#2361)#2531
joshuaellis merged 1 commit into
nextfrom
test/2361

Conversation

@joshuaellis

@joshuaellis joshuaellis commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Lock down the declarative, no-ref useSpring auto-start path under React StrictMode — the exact scenario from the codesandbox in #2361 (and the earlier #2146).

The bug those issues describe was fixed across the v10 line (#2372, #2410, #2430): useSprings now keeps updates in a ref plus a StrictMode restart snapshot, so the double-mount (mount → simulated unmount → mount) re-applies updates instead of leaving the controller stopped with an empty updates array.

But every existing StrictMode test attaches an external ref and calls .start() imperatively. The pure declarative path that real users hit — no ref, animation expected to fire on its own — had no coverage. These two tests close that gap: one for the basic from→to case, one for the looped variant flagged in the issue thread. Both fail against the pre-v10 code and pass on next.

…2361)

Every existing StrictMode test attaches an external ref and starts it
imperatively. The pure declarative, no-ref path from the issue's
codesandbox was uncovered. These guard both the basic from->to case and
the looped variant, which regressed pre-v10 when StrictMode's double
mount left the controller stopped with an empty updates array.
@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 04ab21a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@joshuaellis joshuaellis merged commit 328f2bc into next Jun 9, 2026
21 checks passed
@joshuaellis joshuaellis deleted the test/2361 branch June 9, 2026 13:00
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