我在 react native 中遵循了 React 5 for Drawer Navigation 的文档,但遇到了这个错误。这是我的代码
import React from 'react'
import {
View,
Button,
Text,
} from 'react-native'
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
import Screen1 from './DrawerScreens/Screen1';
import Screen2 from './DrawerScreens/Screen2';
import Screen3 from './DrawerScreens/Screen3';
const Drawer = createDrawerNavigator();
function Navigations()
{
return(
<NavigationContainer>
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={Screen1} />
<Drawer.Screen name="Settings" component={Screen2} />
<Drawer.Screen name="Contacts" component={Screen3} />
</Drawer.Navigator>
</NavigationContainer>
);
}
export default Navigations;
我是本机react的新手,所以不知道该怎么做