Reactjs 如何自定义/扩展react本机动画?

Reactjs 如何自定义/扩展react本机动画?,reactjs,animation,react-native,react-animated,Reactjs,Animation,React Native,React Animated,我想创建一个自定义衰减动画,当特定检查返回true时停止 现在,我的代码如下所示: this.decayAnimation = decay( this.state.animatedXYValue, { velocity: { x: 0.5, y: 0.5 }, deceleration: 0.996, } ); this.decayAnimation.start(); 但是如果x或y值 (不是速度,而是this.state.animatedXYV

我想创建一个自定义衰减动画,当特定检查返回true时停止

现在,我的代码如下所示:

this.decayAnimation = decay(
    this.state.animatedXYValue,
    {
      velocity: { x: 0.5, y: 0.5 },
      deceleration: 0.996,
    }
);
this.decayAnimation.start();
但是如果x或y值

(不是速度,而是
this.state.animatedXYValue:AnimatedValueXY
的实际x或y值)

变得比我们说的500还要大

任何想法都将不胜感激

多谢各位