Open
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?
10.0.1
What's Wrong?
The useTransition sometimes destroys the element before calling transitionApi.start()
resulting in the animation not playing as the element has been destroyed. Video evidence is attached below.
Zaznam.obrazovky.2025-06-04.v.12.11.02.mov
Also, the use of the useTransition
function is problematic when using a spring ref and switching the state from empty array to array of data. The elements are then mounted in the DOM without waiting for the transitionApi.start()
(just the animation is waiting).
To Reproduce
- Setup
useTransition
with the spring ref - Change the state that's in
useTransition
- Call the
transitionApi.start()
- Repeat until it breaks
Expected Behaviour
The useTransition
should wait for the transitionApi.start()
call to mount/unmount the component.