Skip to content

kirkness/react-native-tween-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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(() => {});
  }
});

About

Simple react native state tween animation module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published