1

我正在尝试使用@react-navigation 设置应用程序。

我已经安装了所有必需的依赖项:

"@react-navigation/bottom-tabs": "^5.4.2",
"@react-navigation/native": "^5.3.0",
"@react-navigation/stack": "^5.3.2",
"react-native-safe-area-context": "^1.0.0",
react-native-screens": "^2.7.0",
"@react-native-community/masked-view": "^0.1.10",
"react-native-reanimated": "^1.8.0",
"react-native-gesture-handler": "^1.6.1",

启动应用程序时,我收到有关“measureInWindow”的错误。

wrapNativeSuper.js:10 Unhandled JS Exception: TypeError: Cannot read property 'measureInWindow' of undefined

这似乎与react-native-safe-area-context某些研究有关,但我无法弄清楚为什么这不起作用。自从添加库并重建应用程序以来,我已经安装了 pod,但同样的错误仍然存​​在。如果我删除react-native-safe-area-context,那么 react-navigation 会抱怨它没有被添加。

这个问题是相关的,但答案建议更新 react-navigation 并且我使用的是最新版本:TypeError: Cannot read property 'measureInWindow' of undefined - 这个问题也提到了react-native-safe-area-view,但我相信 react-navigation 不再使用它来支持 -safe -区域上下文。

react-navigation 上的这个问题似乎相关(https://github.com/react-navigation/react-navigation/issues/7933)但它表明 react-native-safe-area-view 正在使用中并且有一个新的版本(未发布?)

4

0 回答 0