Last active
May 8, 2016 14:48
-
-
Save joshwcomeau/f0c4bb1593bed3090dc5f1e31f73101f to your computer and use it in GitHub Desktop.
letter-animation
This file contains hidden or 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 LetterDemo extends Component { | |
constructor(props) { ... } | |
componentWillMount() { ... } | |
componentWillUnmount() { ... } | |
onStart({entering, leaving}, node) { | |
if (entering) { | |
node.classList.add('enter'); | |
} else if (leaving) { | |
node.classList.add('leave'); | |
} else { | |
node.classList.remove('enter', 'leave'); | |
} | |
} | |
renderLetters() { ... } | |
render() { | |
const animations = { ... }; | |
return ( | |
<div className="letter-demo"> | |
<FlipMove {...animations} onStart={this.onStart}> | |
{this.renderLetters()} | |
</FlipMove> | |
</div> | |
); | |
} | |
} | |
export default LetterDemo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment