// the find
chenglou/react-tween-state
React animation.
A React mixin that adds `this.tweenState` and `this.getTweeningValue`, so you set a state field to its final value and render an interpolated value between the old and new numbers. It targets codebases on `React.createClass`, and the repo has not been pushed to since September 2017.
- The model is simple. `setState` gets the final value immediately and the tween only changes what `getTweeningValue` returns, so `this.state` always holds the destination and logic that reads state doesn't see mid-animation values.
- Additive stacking is the default, so a second `tweenState` on the same field blends into the animation already running instead of snapping. That suits interactive UI, and the README explains why rather than just listing the option.
- Easing is a plain `(currentTime, begin, end, duration)` function, so a custom curve is one function and the bundled set comes from the separate tween-functions package.
- It depends on `React.createClass` and mixins, which React removed in version 16. It won't run on any React that someone installing it today would use without a rewrite.
- There are no hooks, no class-component support and no TypeScript types. A current version would be a hook built on requestAnimationFrame, and this repo doesn't provide one.
- The last push was September 2017. The demo link points at rawgit, which is gone. Read it for the stacking design, not as a dependency to adopt.
- `DESTRUCTIVE` with duration 0 skips the easing function, and a delayed destructive tween kills the previous one immediately. The README documents both, but they're easy to hit.