Answer the question
In order to leave comments, you need to log in
Why is ReactCSSTransitionGroup not working?
I stupidly copied the code from the documentation:
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
const Cart = (props) => {
...
return (
<section className="cart">
{items.map(item =>
<ReactCSSTransitionGroup
transitionName="example"
transitionEnterTimeout={5000}
transitionLeaveTimeout={3000}>
<CartItem key={item.id} item={item} />
</ReactCSSTransitionGroup>
)}
</section>
);
};
Answer the question
In order to leave comments, you need to log in
You don't need to wrap every element in a ReactCSSTransitionGroup.
Try like this:
return (
<ReactCSSTransitionGroup
component="section"
className="cart"
transitionName="example"
transitionEnterTimeout={5000}
transitionLeaveTimeout={3000}
>
{items.map(item => <CartItem key={item.id} item={item} />)}
</ReactCSSTransitionGroup>
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question