Reanimated 2 动画 entering/exiting withCallback 错误
Reanimated 2 animation entering/exiting withCallback error
如果我在动画上使用 withCallback 函数 enter/exit 甚至在使用关键帧创建自定义动画时我都会收到错误消息。
我是做错了什么,还是遗漏了什么?
"react-native-reanimated": "^2.3.1",
<Animated.View
entering={SlideInLeft.duration(animationDuration)}
exiting={SlideOutRight.duration(animationDuration).withCallback(()=>{})}
>
<View />
</Animated.View>
固定为
const slideInLeft = SlideInLeft.withCallback((finished: boolean) => {
'worklet';
if (finished) {
yourFoo(
}
});
<Animated.View entering={slideInLeft} >
...
</Animated.View>
如果我在动画上使用 withCallback 函数 enter/exit 甚至在使用关键帧创建自定义动画时我都会收到错误消息。 我是做错了什么,还是遗漏了什么?
"react-native-reanimated": "^2.3.1",
<Animated.View
entering={SlideInLeft.duration(animationDuration)}
exiting={SlideOutRight.duration(animationDuration).withCallback(()=>{})}
>
<View />
</Animated.View>
固定为
const slideInLeft = SlideInLeft.withCallback((finished: boolean) => {
'worklet';
if (finished) {
yourFoo(
}
});
<Animated.View entering={slideInLeft} >
...
</Animated.View>