Fix for transition group trying to call lifecycle methods on undefined component 

When a component has a `TransitionGroup` as a child, and the component is unmounted before the enter (or leave) animation is complete, the following error occurs...

`Uncaught TypeError: Cannot read property 'componentDidEnter' of undefined`

This is a small fix to just make sure `component` is not `undefined` before checking for the `componentDidEnter` and `componentDidLeave` methods.