反应原生; sdk40; 错误:React Native Gesture Handler 控制台上的错误消息:TypeError:无法读取 null 的属性 '__reanimatedWorkletInit'
部分代码出错:
// Animation
const a1X = useSharedValue(0);
const a1Y = useSharedValue(0);
const onA1Move = useAnimatedGestureHandler({
onStart:(event,ctx)=>{ // <<-- the error point stops here, at ":", im using .js
ctx.a1X = a1X.value;
ctx.a1Y = a1Y.value;
},
onActive:(event,ctx)=>{
a1X.value = ctx.a1X + event.translationX;
a1Y.value = ctx.a1Y + event.translationY;
},
onEnd:()=>{
a1X.value = withSpring(0);
a1Y.value = withSpring(0);
}
});
const a1StyleTo = useAnimatedStyle(()=>{
return{
transform:[
{translateX:a1X.value},
{translateY:a1Y.value},
]
}
});
任何有经验的程序员的帮助?