React native navigator已被弃用,即使我没有';不要使用导航器
我的代码中不使用导航器。但我得到了这个错误React native navigator已被弃用,即使我没有';不要使用导航器,react-native,navigation,React Native,Navigation,我的代码中不使用导航器。但我得到了这个错误 任何人都可以帮助我吗?导航器在react native中不再受支持,因此不再允许: 从'react native'导入{Navigator} 从“react native”导入中删除导航器,并将其替换为: import{Navigator}来自'react native deprecated custom components'; 导航实验(以前的导航器)已从React-Native中删除,并移动到一个单独的包React-Native不推荐使用的自
任何人都可以帮助我吗?
导航器在react native中不再受支持,因此不再允许:
从'react native'导入{Navigator}
从“react native”导入中删除导航器,并将其替换为:
import{Navigator}来自'react native deprecated custom components';
导航实验(以前的导航器
)已从React-Native中删除,并移动到一个单独的包React-Native不推荐使用的自定义组件
。它已被弃用,不推荐使用。要修复旧代码,可以执行以下步骤
安装软件包react本机不推荐的自定义组件
npm install react本机不推荐的自定义组件--保存
导入NavigationExperimental(以前的Navigator
)
import NavigationExperimental from'react native deprecated custom compreports'代码>
将Navigator
替换为NavigationExperimental.Navigator
我的IDE自动添加以下行时发生了这种情况:
import * as AsyncStorage from "react-native";
这意味着:该文件中的所有内容都无效。通过更改为以下内容解决了此问题:
import AsyncStorage from "react-native";
react导航是否依赖它?它看起来像是react native implementation
的第120行使用了它。不,它不是必需的。那么,我该如何修复它呢?Navigator已被弃用!其他选项将在这里提及:难以置信!你在这里救了我几个小时!非常感谢你。在我的例子中,它是import*作为“react native”的PropTypes;
import AsyncStorage from "react-native";