My code is very similar to the example in the official React-Router git repo.
Here is a codepen that shows the problem.
Here is the problem: Instead of waiting for the time specified in the transitionEnterTimeout
attribute, the new element is rendered immediately. Then both css animations (enter and leave) run at the same time. After that the previous element gets removed.
I have the same problem locally on a bit more complex setup, that's why I made the simple codepen to see where the problem lies.
I am using the latest versions of all the frameworks (react, react-router, react-addons-css-transition-group)
const App = ({children, location}) => {
return (
<ReactCSSTransitionGroup
component="div"
transitionName="app"
transitionEnterTimeout={500}
transitionLeaveTimeout={500}
>
{children && React.cloneElement(children, {
key: location.pathname,
})}
</ReactCSSTransitionGroup>
);