pmndrs / pmndrs/react-spring

[bug]: Immediate does not work when to is an array

Open
#2,204 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: core kind: bug release: major
Dominant language
TypeScript
Stars
29.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Which react-spring target are you using?
  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog
What version of react-spring are you using?

9.7.3 amd 10.0.0-alpha.1

What's Wrong?

When I have an array for the to-prop in order to chain animations and then set immediate to true, the animation runs normally and does not jump to the goal value.

To Reproduce
  1. use useSpring with an array for the to-prop
  2. set immediate: true
Expected Behaviour

The animation chain should jump right to the end of the last step without animating anything

Link to repo

https://codesandbox.io/s/clever-visvesvaraya-w5f9lg?file=/src/App.js

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the useSpring entry point and trace how an array passed to the to prop is handled alongside immediate. Reproduce the chained animation from the linked CodeSandbox with immediate set to true, then verify that it jumps directly to the final step without animating.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.