Animation Switch not compatible with react-transition-group v2
See original GitHub issueThis is regarding - https://github.com/ReactTraining/react-router/issues/4351
So react-transition-group is superceeding react-addons-css-tranistion-group - https://github.com/reactjs/react-transition-group
Transition API v2 expects immediate children of <TransitionGroup> to be <CSSTransition>.
React Router <Switch> expects immediate children to be of type <Route>.
Does this mean it is not possible to do this with v2 transition api? I put some details/code here - https://github.com/reactjs/react-transition-group/issues/83
Issue Analytics
- State:
- Created 6 years ago
- Comments:27 (8 by maintainers)
Top Results From Across the Web
Animation Switch not compatible with react-transition-group v2
This is regarding - #4351 So react-transition-group is superceeding react-addons-css-tranistion-group ...
Read more >Components not animating with react-transition-group, just ...
The element get's added with a class of sidepage which has a opacity of 0.4, thats whats breaking the animation. Working demo here....
Read more >Using React Transition Group to improve UI - LogRocket Blog
To put it simply, React Transition Group offers a more straightforward approach to animations and transitions. Installing react-transition-group.
Read more >React Transition Group
Exposes simple components useful for defining entering and exiting transitions. React Transition Group is not an animation library like React-Motion, ...
Read more >react-transition-group - npm
A react component toolset for managing animations. ... the API in v2 and above is not backwards compatible with the original React addon ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@DGizmo Seems like the problem is that ReactDOM.findDOMNode(this) returns null when your component switch to exit state.
As in facebook/react#4651, ReactDOM.findDOMNode will return null when the component is unmounted or the ref changes. Are you unmounting or re-referencing the DOM node inside your route?
I don’t know enough about your setup to give a suggestion, but in my personal experience, I always found it very helpful to wrap everything inside CSSTransition with a div. This will not only ensure that CSSTransition always have a DOM node to work on (so findDOMNode won’t return null), but also allow me to separate route transition and all the other animation within the route (otherwise, the animation will be applied to the outermost DOM node inside your route, which might not be what you want)
So here is how you can wrap your routes, notice the div with class WRAPPER:
And the classNames you give CSSTransition will be applied to this div:
Give it a try 😃. Let me know if the issue still persists.
Not sure whether this is what you want, but here is how I use react-transition-group v2 with react-router v4: