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

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

Open peeke opened this issue 2 years ago • 7 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?

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

peeke avatar Apr 07 '22 14:04 peeke

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 !

Camsteack avatar May 09 '22 09:05 Camsteack

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

StevenStavrakis avatar May 23 '22 03:05 StevenStavrakis

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

hiebj avatar Jul 22 '22 23:07 hiebj

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

delyan-peev avatar Mar 10 '23 14:03 delyan-peev

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.

joshuaellis avatar Apr 09 '23 08:04 joshuaellis

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

sctgraham avatar Jan 03 '24 14:01 sctgraham

hi, same problem

Tankonyako avatar Jan 04 '24 23:01 Tankonyako