找不到导航对象。您的组件位于 NavigationContainer 内吗?在移动应用程序开发中

问题描述 投票:0回答:1

您好,我在使用 React Native 导航时遇到了问题,您能帮忙吗? 我有 2 页,这些都是空白的,可以登录。在空白页面中,我有一个按钮,按下该按钮时我想更改为空白页面以登录

enter image description here enter image description here

我尝试了一切,但效果不佳

reactjs navigation native
1个回答
0
投票

我认为这将是一个依赖性问题。

尝试再次安装它们。

npm 安装@react-navigation/native

For expo project

npx 博览会安装react-native-screens React-native-safe-area-context

另外,安装这个。

npm 安装@react-navigation/native-stack

npx expo 安装react-native-gesture-handler

如果问题没有解决,请再次检查组件(导入导出 - 默认)。

© www.soinside.com 2019 - 2024. All rights reserved.