cheapsteak / react-transition-group-plus

A more full-featured transition group for React
Other
268 stars 20 forks source link

trying to access componentDidEnter after component unmounted? #12

Open jebeck opened 7 years ago

jebeck commented 7 years ago

I'm using TransitionGroupPlus to perform enter and leave animations of a component based on mouseover and mouseout on another target element(s). Seeing a bunch of errors like this when moving the mouse quickly on an off various targets:

screenshot 2017-01-20 09 29 10

So component is undefined here - I suspect already unmounted. What do you think about changing this line to if (component && component.componentDidEnter). I'll admit I haven't read all the source yet, so I don't know if such a change is likely to cause other problems. The change does work for me locally.

I you do agree, I'm happy to submit the tiny PR if you like ;)

cheapsteak commented 7 years ago

That's a great idea! Please send the PR :)

jebeck commented 7 years ago

Done in #14!

cheapsteak commented 7 years ago

Thank you! Published as 0.4.1