fix: Stepper animation with react-spring ^10.0.1#603
Merged
Conversation
Collaborator
✅ Heimdall Review Status
✅
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
✅
1/1
|
Denominator calculation
|
adrienzheng-cb
temporarily deployed
to
production
April 9, 2026 00:53 — with
GitHub Actions
Inactive
adrienzheng-cb
temporarily deployed
to
production
April 9, 2026 00:54 — with
GitHub Actions
Inactive
adrienzheng-cb
temporarily deployed
to
production
April 9, 2026 00:56 — with
GitHub Actions
Inactive
adrienzheng-cb
temporarily deployed
to
production
April 9, 2026 00:57 — with
GitHub Actions
Inactive
Contributor
Author
|
@cb-ekuersch /github-repo-manager skill was really helpful. For some reason it was a lot more effective than me asking agent to research package version difference directly. |
sverg-cb
approved these changes
Apr 9, 2026
sverg-cb
left a comment
Contributor
There was a problem hiding this comment.
thank you so much for the screen recordings!
adrienzheng-cb
temporarily deployed
to
production
April 9, 2026 01:07 — with
GitHub Actions
Inactive
adrienzheng-cb
temporarily deployed
to
production
April 9, 2026 01:07 — with
GitHub Actions
Inactive
sverg-cb
approved these changes
Apr 9, 2026
Contributor
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
react-springto v10useSpringsinitializer in both web and mobile Stepper to usefrominstead of a direct value, preventing stale declarative updates from resetting animation stateContext
A customer reported that after upgrading
@react-spring/webfrom v9 to v10, the Stepper component's visited step progress bars disappear. This is caused by a known upstream bug introduced in react-spring v10.Root cause
In v10, the internal
updatesvariable inuseSpringswas changed from a local variable (recreated fresh each render) to auseRef(persists across renders) for React 19 compatibility (PR #2368). This causes the initial declarative update to be re-applied on every re-render via the layout effect, even when deps haven't changed.Our Stepper initialized springs with
progress: 0, which react-spring interprets asto: { progress: 0 }. On every re-render in v10, this staletotarget is re-applied, resetting visited progress bars back to 0% before the imperativeuseEffectcan restore them.Fix
Changing
progress: 0tofrom: { progress: 0 }ensures the initializer only sets the starting position without declaring an animation target. When v10 re-applies the stale update, it harmlessly updatesfrominstead of resetting the current animation value.The
immediateprop was also removed from the initializer since the existinguseEffectalready passes it on every.start()call.This fix is backward compatible with react-spring v9 — the
useEffectalready handles all animation state transitions including mount (viapreviousActiveStepIndexstarting at-1).This fixed have been verified against both react-spring v9.7.4 (version used in cds-web and cds-mobile) and v10.0.2 (consumer version)
UI changes
Before
Screen.Recording.2026-04-07.at.2.25.57.PM.mov
After
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-04-08.at.20.45.13.mov
Screen.Recording.2026-04-08.at.8.45.31.PM.mov
Testing
How has it been tested?
Testing instructions
Update react-spring package version to ^10.0.2 in mobile and web repo, and then run storybook and mobile-app
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false