[英]Unable to resolve “react-navigation-drawer” from “App.js”
我的 react-navigation 抽屜不工作,我在運行應用程序時收到此錯誤,任何解決此問題的建議。
Unable to resolve "react-navigation-drawer" from "App.js"
import React from 'react';
import {createAppContainer} from 'react-navigation';
import {createDrawerNavigator} from 'react-navigation-drawer';
import {Dimensions} from 'react-native';
import {Feather} from 'expo/vector-icons'
import { ProfileScreen, MessageScreen, ActivityScreen, ListScreen, ReportScreen, StatisticsScreen, SignoutScreen} from './screens';
const DrawerNavigator = createDrawerNavigator({
ProfileScreen,
MessageScreen,
ActivityScreen,
ListScreen,
ReportScreen,
StatisticsScreen,
SignoutScreen
})
export default createAppContainer(DrawerNavigator);
您尚未在項目中安裝react-navigation-drawer
並且您正在嘗試使用它。
在您的項目目錄中運行yarn add react-navigation-drawer
然后它應該可以工作。
嘗試import {createDrawerNavigator} from 'react-navigation-drawer';
import {createDrawerNavigator} from "@react-navigation/drawer";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.