Is there a way to run the function after the holiday animation is complete? Or is my only alternative to using a low-level animation API ? If so, I assume that I would have to implement all the functionality of the transition (transition, return, etc.)?
Js
var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup; var SignalContent = React.createClass({ render: function() { return ( <div className='signal'> <p className='signal-message'>{this.props.message}</p> <button onClick={this.props.onClose} aria-label='Close'><span className='material-icons'>close</span></button> </div> ); } }); var Signal = React.createClass({ handleClose: function() { this.setState({active: false})
CSS
.signal { padding: 10px; color: #fff; background-color: #000; } .signal-transition-appear { opacity: 0; } .signal-transition-appear-active { opacity: 1; transition: .5s; } .signal-transition-leave-active { opacity: 0; transition: .5s; }
JSFiddle . In the example, I try to run handleClose() when the signal has completed the animation.
source share