react-transition-group icon indicating copy to clipboard operation
react-transition-group copied to clipboard

All nodes will be rendered when react key exists in the children of the TransitionGroup

Open MisterLuffy opened this issue 1 year ago • 1 comments

What is the current behavior?

All nodes will be rendered when a key exists in the children of the TransitionGroup.

Just try this Demo, after the react key is removed, conditional rendering will return to normal.

Kapture 2022-10-13 at 17 07 51

What is the expected behavior?

Conditional judgment can take effect.

MisterLuffy avatar Oct 13 '22 09:10 MisterLuffy

I think this might be less about having a key and more about TransitionGroup failing to unmount children which aren't Transition / CSSTransition elements?

https://codesandbox.io/s/funny-resonance-1252uf?file=/demo.js

I was using an older version of TransitionGroup to render dialogs / tooltips / popovers etc. stacked in the order they were opened. Some of these components need to animate and therefore use Transition but many don't so they simply render regular elements.

Not sure if this is a 'feature' that could be added back; from what I can tell it was removed in v2 so quite a long time ago?

richardscarrott avatar Nov 11 '22 09:11 richardscarrott