React animation hook that tweens a number between 0 and 1.
import {useTween} from 'react-use';
const Demo = () => {
const t = useTween();
return (
<div>
Tween: {t}
</div>
);
};useTween(easing?: string, ms?: number, delay?: number): numberReturns a number that begins with 0 and ends with 1 when animation ends.
easingβ one of the valid easing names, defaults toinCirc.msβ milliseconds for how long to keep re-rendering component, defaults to200.delayβ delay in milliseconds after which to start re-rendering component, defaults to0.