Hacker News new | past | comments | ask | show | jobs | submit login

That's what transition groups do. When you wrap something I a transition group, it will generate events when a child is removed or added, allowing you to add required transition effects.

The CSS transition group is pretty useful: When a child is removed, it is kept in the DOM, with a CSS "exit" class added (here you could have a CSS transition for opacity, for example), and then finally removed when React determines that the animation is done. Conversely, added nodes get an "enter" class.

Transition groups are explicit -- you have to wrap your components in them -- and that's a good thing, as it allows you to control what kinds of transitions are used in different contexts.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: