-
-
Save cheapsteak/4f5ae02e62a3bbd2611b3a37847aac9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Box extends React.Component { | |
componentWillEnter (callback) { | |
const el = this.container; | |
TweenMax.fromTo(el, 0.3, {y: 100, opacity: 0}, {y: 0, opacity: 1, onComplete: callback}); | |
} | |
componentWillLeave (callback) { | |
const el = this.container; | |
TweenMax.fromTo(el, 0.3, {y: 0, opacity: 1}, {y: -100, opacity: 0, onComplete: callback}); | |
} | |
render () { | |
return <div className="box" ref={c => this.container = c}/>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment