这些文件都不存在: * node_modules\@react-navigation\drawer\src\views\DrawerToggleButton(.native|.ios.ts|.native.ts|.ts|.ios.tsx

问题描述

我正在尝试向我的 React-native expo 应用程序添加一个抽屉。但是运行后,它给了我标题中提到的错误。我觉得好像缺少一些对等依赖项,但是我在这里安装了 react 导航文档中提到的任何内容https://reactnavigation.org/docs/getting-started#installing-dependencies-into-an-expo-managed-project

这是错误来自哪里的代码

import 'react-native-gesture-handler'; // must be very first import
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet,Text,View,AppRegistry } from 'react-native';
// components
import LandingPage from './src/components/LandingPage';
import Home from './src/components/Home';
import MainMenu from './src/components/headers/MainMenu';

// navigation tools
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import {createDrawerNavigator} from '@react-navigation/drawer';

const Drawer = createDrawerNavigator();
const Stack = createStackNavigator();

export default function App() {
  return (
    // router page navigation
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen 
          name='Home'
          component={Home}
          options={{
            headerLeft: (props) => (
              <MainMenu />
            ),headerTitle: (props)=> (
              <Text style={{fontSize: 22,marginBottom: 10}}>Home</Text>
            )
          }}
        />
        <Stack.Screen 
          name='landing'
          component={LandingPage}
          options={{ headerShown: null,animationTypeForReplace: 'pop' }}
        />
      </Stack.Navigator>
      <Drawer.Navigator>
        <Drawer.Screen name="another" component={Home} />
      </Drawer.Navigator>
    </NavigationContainer>
  );
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...