fix(core): infer all animated keys when a partial from is provided#2545
Merged
Conversation
🦋 Changeset detectedLatest commit: efcdbde The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
Stands up a vitest --typecheck type-test harness and uses it to fix a PickAnimated regression that dropped forward props, `to` keys, and the other transition phases from the inferred state whenever a partial `from` was set. Also revives the orphaned spec.ts type suites and locks the public type surface behind #2541 against regression.
16f53cc to
efcdbde
Compare
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stands up type-level testing for react-spring and uses it to fix a real inference regression. When a
fromprop is provided but doesn't list every animated key,useSpring/useSprings/useTransitionwere dropping the other keys from their inferred state —useSpring({ width: 100, height: 100, from: { width: 0 } })typed its result as{ width }, sostyles.heightwas a compile error even thoughheightanimates fine at runtime.PickAnimatednow mergesfromwith theto, forward, and transition-phase values instead of replacing them.Type-level test harness
Adds a
typesVitest project (vitest --typecheck) and atest:typesscript, wired intotestandrelease. Assertions useexpectTypeOf; cases that are known but not yet fixable are pinned with@ts-expect-error, which starts failing the moment the underlying issue is resolved, so nothing rots silently.Regression coverage
Locks the public type surface against the bugs behind #2541. #2006, #1114 and #1483 are already resolved by the v11 rewrite — these tests stop them regressing. #2183 is covered on the type side; its remaining symptom is runtime and is captured on the issue. The per-key event-handler
anyleak is documented with a self-policing guard pending a separate fix.Reviving the type tests
The
spec.tstype suites undersrc/types/__tests__were excluded fromtsc, run by no project, and had drifted out of date — which is exactly how thefromregression went unnoticed. They're now co-located beside the code they cover, running under both gates, and brought back in line with current behaviour. The tsconfig exclusion that hid them is removed.