react-spring icon indicating copy to clipboard operation
react-spring copied to clipboard

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

Open sators opened this issue 2 years ago • 1 comments

Which react-spring target are you using?

  • [X] @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

sators avatar Aug 17 '23 15:08 sators

Similar to #2171 but with working codesandbox

sators avatar Aug 17 '23 15:08 sators