pmndrs / pmndrs/react-spring

[bug]: useTransition not working if called with dependency array

Open
#2,189 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: core kind: bug
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.1

What's Wrong?

useTransition springs are not starting if called with a dependency array in >=v9.5.0. It works as expected and documented <=v9.5.0.

To Reproduce

Open codesandbox
Click the toggle button (nothing happens)
Switch to v 9.5.0
Click toggle button again (a div is animating in)

Expected Behaviour

I expected useTransition to animate if the state in the dependency array changes.

Link to repo

https://codesandbox.io/s/loving-snyder-6llsgg

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 with the linked CodeSandbox and the useTransition entry point, comparing behavior between react-spring 9.7.1 and 9.5.0 when a dependency array changes. Done means the web target animates the div after toggling with the dependency array, matching the documented behavior in 9.5.0.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.