Skip to content

Instantly share code, notes, and snippets.

Created March 13, 2016 06:06
Show Gist options
  • Save anonymous/66dd118192bb4cc1a989 to your computer and use it in GitHub Desktop.
Save anonymous/66dd118192bb4cc1a989 to your computer and use it in GitHub Desktop.
class Box extends React.Component {
componentWillEnter (callback) {
const el = findDOMNode(this);
TweenMax.fromTo(el, 0.3, {y: 100, opacity: 0}, {y: 0, opacity: 1, onComplete: callback});
}
componentWillLeave (callback) {
const el = findDOMNode(this);
TweenMax.fromTo(el, 0.3, {y: 0, opacity: 1}, {y: -100, opacity: 0, onComplete: callback});
}
render () {
return <div className="box"/>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment