Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native navigator已被弃用,即使我没有';不要使用导航器_React Native_Navigation - Fatal编程技术网

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";