【发布时间】:2022-10-24 17:51:16
【问题描述】:
我刚刚升级到 react native 0.67.3,现在当我打开使用 react navigation v6 的应用程序时,我收到此错误:
Occurred in worklet location: /Users/path/thing/node_modules/react-native-reanimated/lib/reanimated2/hook/useAnimatedStyle.js (332:24)
Possible solutions are:
a) If you want to synchronously execute this method, mark it as a Worklet
b) If you want to execute this method on the JS thread, wrap it using runOnJS
2022-03-09 10:54:14.180294-0500 thing[1949:15686] [native] Tried to synchronously call anonymous function from a different thread.
Occurred in worklet location: /Users/path/thing/node_modules/react-native-reanimated/lib/reanimated2/hook/useAnimatedStyle.js (332:24)
我目前正在像这样使用 DrawerNavigator:
<Drawer.Navigator initialRouteName="Home" >
<Drawer.Screen name="HomeStack" component={HomeStack} />
</Drawer.Navigator>
这是我的相关软件包版本:
"react-native-reanimated": "2.3.1",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.3.11",
"react-native-gesture-handler": "^1.9.0"
DrawerNavigator 中的任何想法可能导致此问题以及如何解决?
【问题讨论】:
标签: react-native react-navigation