pmndrs / react-spring

✌️ A spring physics based React animation library
http://www.react-spring.dev/
MIT License
27.93k stars 1.19k forks source link

[bug]: exitBeforeEnter in useTransition doesn't work when used with trail #1868

Open peeke opened 2 years ago

peeke commented 2 years ago

Which react-spring target are you using?

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

Camsteack commented 2 years ago

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 !

StevenStavrakis commented 2 years ago

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:

Link to CSB

hiebj commented 2 years ago

another repro https://codesandbox.io/s/repro-usetransition-trail-problems-j3zkdq?file=/src/index.js:854-870

delyan-peev commented 1 year ago

I share the pain on this one. Is this something we can expect a fix for in the foreseeable future @joshuaellis?

joshuaellis commented 1 year ago

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.

sctgraham commented 7 months ago

Any updates on this, or in the interim, a viable workaround ? Many thanks !

Tankonyako commented 7 months ago

hi, same problem