Simple react native state tween animation module.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Henry Kirkness Henry Kirkness
Henry Kirkness and Henry Kirkness Corrected example
Latest commit 35e0d79 May 5, 2015
Permalink
Failed to load latest commit information.
.gitignore Initial commit May 5, 2015
README.md Corrected example May 5, 2015
index.js Initial commit May 5, 2015
package.json Corrected example May 5, 2015

README.md

react-native-tween-animation

A simple react native state tween animation module.

Usage

var animation = new RNTAnimation({

  // Start state
  start: {
    top: this.state.position.top,
    left: this.state.position.left
  },

  // End state
  end: {
    top: 0,
    left: 0
  },

  // Animation duration
  duration: 500,

  // Tween function
  tween: 'easeOutBack',

  // Update the component's state each frame
  frame: (tweenFrame) => {
    this.setState({
      position: tweenFrame
    });
  },

  // Optional callback
  done: () => {

    console.log('All done!');

    // Optionally reverse the animation
    animation.reverse(() => {});
  }
});