question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Special lifecycle hooks are not being called when using `ReactCSSTransitionGroup`

See original GitHub issue

When using <ReactCSSTransitionGroup> on a component, the special lifecycle hooks are not being called.

I think it would be useful and nice to know when a transition occurs and which state the transition owns.

I guess ComponentWillEnter, ComponentDidEnter and other special methods were meant to expose those states, but I cannot make it work, unless I use <ReactTransitionGroup>, but this way css classes are not being applied during the transition.

Documentation here (http://facebook.github.io/react/docs/animation.html) states:

“ReactTransitionGroup is the basis for animations. When children are declaratively added or removed from it (as in the example above) special lifecycle hooks are called on them.”

“The example above” is using <ReactCSSTransitionGroup>, so one would expect to have those special hooks being called, but it seems they don’t.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
droidenatorcommented, Dec 19, 2016

@gaearon If the plan is still to deprecate the addons, would it be possible to add a deprecation notice to the React docs? The page for reactCSSTransitionGroup still comes up very high in search results and there’s no indication that the addon will be deprecated. I just happened to stumble on this issue while trying to get reactCSSTransitionGroup to work for me.

Adding that deprecation notice might save some people some time in the future.

0reactions
gaearoncommented, Feb 1, 2017

This is the official repo for TransitionGroup now: https://github.com/reactjs/react-transition-group

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactTransitionGroup Lifecycle Hooks Do Not Work
At first, i want to make a carousel by ReactCSSTransitionGroup, but there is a simple css transition. If i want to add some...
Read more >
Animation Add-Ons - React
The example below would not work, because the ReactCSSTransitionGroup is being mounted along with the new item, instead of the new item being...
Read more >
Animation | React - GitHub Pages
ReactCSSTransitionGroup is based on ReactTransitionGroup and is an easy way to ... it (as in the example above) special lifecycle hooks are called...
Read more >
Why hooks are the best thing to happen to React
Hooks allow you to use state, lifecycle methods, and other functionalities of React without using classes. This article will explain what ...
Read more >
Can't resolve 'react-transition-group' in primereact dropdown ...
Try installing the package with npm install react-transition-group . ... React transition group is not working when using a function to out components ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found