Check whether component actually exists before

When using ReactCSSTransitionGroup and adding a node by replacing a null-child React will complain with a `TypeError: Cannot read property 'componentWillLeave' of undefined` the first time. This change fixes that.