fix(core): propagate immediate flag to to-array chain steps - #2557
fix(core): propagate immediate flag to to-array chain steps#2557ErfanBagheri404 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: e7aa772 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 |
Isolate PR pmndrs#2557 onto next — single commit.
22d8985 to
e7aa772
Compare
|
Thanks for the PR. We're going to close this one, but I want to explain the reasoning clearly since the underlying request is valid. The short version: ctrl.start({ to: [{ t: 1 }, { t: 2 }], default: { immediate: true } })This already works today and is consistent with how the async-script path ( Why we can't merge this specific change:
That said — enough people keep hitting this that I don't think the answer is "read the docs." Bare |
Summary
When
immediate: trueis set with an arraytoprop, each step in the chain should start immediately. Previously the flag was only checked inSpringValue.start(), but whentois an array,SpringValue.start()delegates torunAsync(), which did not propagateimmediateto each step.This caused the chain to animate each step sequentially instead of jumping immediately to the final value.
Changes
runAsync.ts: propagateprops.immediateto each step in thetoarray chain when it is not explicitly set on the step itselfTest plan
Controller.test.ts@react-spring/core: patchLinks