fix(AnimatedCoordinatesArray): bind decay to the new progress value - #4294
Open
giaBaoJS wants to merge 1 commit into
Open
fix(AnimatedCoordinatesArray): bind decay to the new progress value#4294giaBaoJS wants to merge 1 commit into
giaBaoJS wants to merge 1 commit into
Conversation
giaBaoJS
requested a deployment
to
CI with Mapbox Tokens
September 6, 2026 16:26 — with
GitHub Actions
Waiting
giaBaoJS
requested a deployment
to
CI with Mapbox Tokens
September 6, 2026 16:26 — with
GitHub Actions
Waiting
giaBaoJS
requested a deployment
to
CI with Mapbox Tokens
September 6, 2026 16:26 — with
GitHub Actions
Waiting
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.
Description
AnimatedCoordinatesArray#decay()throws as soon as the returned animation is started, so the method is unusable.timing()andspring()on the same class work.Reproducer:
Before the fix,
.start()raises:After the fix the animation starts and the coordinates move towards the target.
Root cause
decay()creates a localprogressValue, hands it toanimate(), but passesthis.progressValuetoAnimated.decay.this.progressValueis only assigned later, inside theonAnimationStarthook thatanimate()installs, so it is stillundefinedwhen the decay animation is built. The sibling methodstiming()andspring()pass the localprogressValue.Test
__tests__/utils/animated/AnimatedCoordinatesArray.test.jsgainstestDecay. It asserts that the value handed toAnimated.decayis theAnimated.Valuethe array subscribes to, then starts the animation, advances one frame, and asserts the first coordinate has moved off its start value without passing the target.With the source change reverted the new test fails on that assertion:
With the change
yarn jestgoes from 112 to 113 passing tests, 22 suites, no failures.yarn eslinton both changed files is clean, andyarn typecheckreports the same pre-existing errors as onmain(all underexample/).The defect is in plain JavaScript with no native side, so it reproduces headlessly under the repo's own jest setup rather than in the
/exampleapp. No generated code is affected, soyarn generatewas not needed.Checklist
CONTRIBUTING.md