【问题标题】:createDrawerNavigation() has been moved to react-navigation-drawercreateDrawerNavigator() 已移至 react-navigation-drawer
【发布时间】:2019-09-08 09:47:57
【问题描述】:

【问题讨论】:

  • 呃,这是一个问题还是一个陈述?

标签: react-native react-navigation react-navigation-drawer


【解决方案1】:

您似乎正在尝试从 react-navigation 库中导入 createDrawerNavigator()。但是,此功能已移至react-navigation-drawer。该错误已经告诉你到底发生了什么。如果您查看the documentation 这个错误链接您,您会发现要导入的内容:

import { createDrawerNavigator } from 'react-navigation-drawer'; 

【讨论】:

【解决方案2】:

对于初学者>

对于项目或 src 中的 App.js 导入,从“react-navigation”到“react-navigation-drawer”的导入中删除 {createDrawerNavigator}

例如: From => import {createDrawerNavigator, createStackNavigator, createAppContainer} from "react-navigation";

Remove => import {createStackNavigator, createAppContainer} from "react-navigation";

To => 从 'react-navigation-drawer' 导入 {createDrawerNavigator};

【讨论】:

    猜你喜欢
    • 2020-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-29
    • 1970-01-01
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多