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

[bug]: animation broken on v10

Open alexkahndev opened this issue 8 months ago • 5 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?

10.0.1

What's Wrong?

I have an animation for a dropdown container that grows it and fades it in. Through version 9.7.5 and even an older version of the beta this animation worked. On version 10 this animation no longer fires. Adding an onChange shows its never fired on v10. I have other animations that work with v10 but I think maybe scale may be the culprit here

To Reproduce

You can reproduce the bug by running the project at https://github.com/alexkahndev/react-spring-v10-bug. You will notice that no dropdown appears and no animation is run.

Expected Behaviour

https://github.com/user-attachments/assets/6ee5b04f-f1d6-4a4c-ae9c-db2b9123fb13

Link to repo

https://github.com/alexkahndev/react-spring-v10-bug

alexkahndev avatar May 24 '25 09:05 alexkahndev

This might be related to the issue I'm also seeing with the imperative API: https://github.com/pmndrs/react-spring/issues/2377

What happens if you downgrade from 10.0.1 back to 10.0.0, can you still see the issue? For me, it was the patch version bump that broke the imperative API for me.

terrymun avatar May 24 '25 17:05 terrymun

For my issue even on version 10.0.0 it does not animate. The last working version for this animation is 9.7.5

alexkahndev avatar May 24 '25 18:05 alexkahndev

+1

GoncharovV avatar Jun 05 '25 15:06 GoncharovV

Same for me, the last working version is 9.7.5

With 10.0.0 and greater the imperative API doesn't work anymore

diegomacario avatar Jun 05 '25 16:06 diegomacario

When adding React 19 support, the updates in both useSprings (which is internally used for useSpring) were replaced with a ref. This seems to cause fuckery all over the place.

Here is the specific change: https://github.com/pmndrs/react-spring/pull/2368/files#diff-e1288b0efcce202f0575295aec86c6f33c5d81adac9751131dc5d2b08e40e73a

packages/core/src/hooks/useSprings.ts:131

@dagatsoin since you introduced the change: what was the reason - and could we rollback this?

uelibaumgartner avatar Nov 04 '25 17:11 uelibaumgartner