module.exports = React.createClass({ componentWillEnter(cb) { doSomeAsyncAnimationStuff(function() { cb(); }); }, componentDidEnter() { // Called after cb arg from componentWillEnter is called }, componentWillLeave(cb) { doSomeAsyncAnimationStuff(function() { // Call the callback when your done or this component will never unmount // and your app will break cb(); }); }, componentDidLeave() { // Called after cb arg from componentWillLeave is called // The component will be unmounted but you can clean things up here }, render: function() { return (
Hey now
); } });