Skip to content

Instantly share code, notes, and snippets.

@natew
Created December 6, 2014 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natew/a6849b0b6301acebb85f to your computer and use it in GitHub Desktop.
Save natew/a6849b0b6301acebb85f to your computer and use it in GitHub Desktop.
module.exports = Component('Icon', {
mixins: [TweenState.Mixin],
getInitialState() {
return { step: 0 };
},
componentWillReceiveProps(nextProps) {
if (nextProps.animation === 'ROTATE')
this.rotate();
},
rotate() {
this.tweenState('step', {
endValue: 1,
duration: 400,
onEnd: this.rotate()
});
},
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment