react-spring
react-spring copied to clipboard
[bug]: exitBeforeEnter in useTransition doesn't work when used with trail
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.4.2
What's Wrong?
When using useTransition
with both the trail
and exitBeforeEnter
option set, the spring freezes after the leave transitions are done. When uncommenting either, it works.
To Reproduce
Provide useTransition
with both a trail
and a exitBeforeEnter
option.
Checkout the code sandbox: https://codesandbox.io/s/6-loading-spinner-forked-edl8d3?file=/src/SplitWords.js
When clicking next, the words animate out, but never animate in. If you uncomment trail
or exitBeforeEnter
and refresh, it works.
Expected Behaviour
I would expect the words to animate out with a trail. When there are all animated out, I expect the enter transition of the updated words to start.
Link to repo
https://codesandbox.io/s/6-loading-spinner-forked-edl8d3?file=/src/SplitWords.js
Hi ! Are there any update on this issue ? It becomes quite difficult to animate simple list filtering with useTransition
as when using just exitBeforeEnter
there is a big delay between the unmount of the previous components and the enter transition of the new ones and I can't seem to be able to change that.
Thanks !
I was about to make a new issue when I saw that this is already here. Here is another CSB of the issue if it helps:
another repro https://codesandbox.io/s/repro-usetransition-trail-problems-j3zkdq?file=/src/index.js:854-870
I share the pain on this one. Is this something we can expect a fix for in the foreseeable future @joshuaellis?
I share the pain on this one. Is this something we can expect a fix for in the foreseeable future @joshuaellis?
sorry for the late reply, it's on the list but just as many bugs are. Consider sponsoring the project if you'd like to see more time dedicated to it, as you can imagine it's a constant juggle for myself.
Any updates on this, or in the interim, a viable workaround ? Many thanks !
hi, same problem