0.0.1 • Published 6 years ago
react-es6-tween v0.0.1
react-es6-tween
An declarative React.js wrapper for es6-tween tweening library
Installation
npm i react-es6-tween
# or
yarn i react-es6-tweenUsage
Note: For detailed info about how-to use and how it works, please refer to es6-tween repository
import React from 'react';
import ES6Tween from 'react-es6-tween';
const MyAnimation = () => (
<ES6Tween from={{ x: 0 }} to={{ x: 200 }}>
<div id="my-node" />
</ES6Tween>
);See example.html at GitHub repository of react-es6-tween for better understanding
Warning: When component is unmounted, tween will be stopped and can be resume after only remount
Props
Updateable props
isPlayingoptional - If false, tween pauses until you pass trueisStopeedoptional - If true, tween will stop and removed from tick storeisReversedoptional - If true, tween will reverse (likefrom <-> to)
Static Props
fromrequired - Tween initial valuetorequired - Tween target valuedurationrequired - Tween durationautoPlayoptional - When set this totrue, tween auto-plays when wrapped component is mountedeasingpreferred - Gives animation reality, recommended to useinterpolationoptional - For complex tweens, useful for Games or Complex animationsrepeatoptional - How much times tween should repeatyoyooptional - Used with combination ofrepeatdelayoptional - Delay before tween will startonStart,onUpdate,onCompleteoptional - Callbacks
License
MIT
0.0.1
6 years ago