Skip to content

Instantly share code, notes, and snippets.

@joshwcomeau
Last active May 8, 2016 14:48
Show Gist options
  • Save joshwcomeau/f0c4bb1593bed3090dc5f1e31f73101f to your computer and use it in GitHub Desktop.
Save joshwcomeau/f0c4bb1593bed3090dc5f1e31f73101f to your computer and use it in GitHub Desktop.
letter-animation
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