react-spring
react-spring copied to clipboard
[bug]: useTransition not working if called with dependency array
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
Similar to #2171 but with working codesandbox