React native React Native Reanimated:类型为';动画节点<;数量>';不可分配给类型为';编号';。ts(2345)

React native React Native Reanimated:类型为';动画节点<;数量>';不可分配给类型为';编号';。ts(2345),react-native,react-native-reanimated,react-native-drawer,react-native-reanimated-v2,React Native,React Native Reanimated,React Native Drawer,React Native Reanimated V2,我需要使用React Native Reanimated()创建抽屉动画 在更新之前,插值方法可以使用2个参数正常工作。 它的用法是 interpolate( props.progress, { [0, 1], [1, 0.85], Extrapolate.CLAMP } ); 但在更新之后,该方法将采用3到4个参数 interpolate( props.progress, [0, 1], [1, 0.85], Extrapol

我需要使用React Native Reanimated()创建抽屉动画

在更新之前,插值方法可以使用2个参数正常工作。 它的用法是

interpolate(
   props.progress,
   {
    [0, 1],
    [1, 0.85],
    Extrapolate.CLAMP
   }
);
但在更新之后,该方法将采用3到4个参数

interpolate(
   props.progress,
   [0, 1],
   [1, 0.85],
   Extrapolate.CLAMP
);
现在我得到的错误如下

Argument of type 'AnimatedNode<number>' is not assignable to parameter of type 'number'
类型为“AnimatedNode”的参数不能分配给类型为“number”的参数
我当前版本的React Native Reanimated是2.1.0

通过抽屉内容传递道具(抽屉内容组件道具),如下所示

drawerContent={(道具)=>{
常量比例=插值(
道具,进步,
[0, 1],
[1, 0.85],
外推钳
);
常量边界半径=插值(
道具,进步,
[0, 1],
[0, 10],
外推钳
);
屏幕样式={
转换:[
{
scaleY:scale,
},
],
边界半径,
};
返回;
}}
```

在《复活2》中,interpolate被重命名为interpolateNode。所以我对代码做了如下更改

...
const scale = interpolateNode(props.progress, {
 inputRange: [0, 1],
 outputRange: [1, 0.85],
 extrapolate: Extrapolate.CLAMP,
});

const borderRadius = interpolateNode(props.progress, {
 inputRange: [0, 1],
 outputRange: [1, 10],
 extrapolate: Extrapolate.CLAMP,
});
...

而且它工作正常

您从何处进行更新?1.x到2.x?他们的文件说,interpolate更名为interpolateNode。他们的文档还说,第一个参数是一个节点,而不是一个数字。“不过,您还没有向我们展示什么是道具。进度。@窗台问题已编辑。”。感谢您的建议,这里的props.progress是动画的。节点类型和插值方法只需要数字。
...
const scale = interpolateNode(props.progress, {
 inputRange: [0, 1],
 outputRange: [1, 0.85],
 extrapolate: Extrapolate.CLAMP,
});

const borderRadius = interpolateNode(props.progress, {
 inputRange: [0, 1],
 outputRange: [1, 10],
 extrapolate: Extrapolate.CLAMP,
});
...