简体   繁体   English

React Native,React-Navigation

[英]React Native, React-Navigation

Can you help me on this problem:你能帮我解决这个问题吗:

Failed to compile /home/coding/Документы/React-native/instagram/node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js Module not found: Can't resolve 'react-native-screens' in '/home/coding/Документы/React-native/instagram/node_modules/@react-navigation/stack/lib/module/views/Stack'无法编译/home/coding/Документы/React-native/instagram/node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js 找不到模块:无法解析'react-native-screens ' 在 '/home/coding/Документы/React-native/instagram/node_modules/@react-navigation/stack/lib/module/views/Stack'

This is source code:这是源代码:

import { StatusBar } from "expo-status-bar";
import React from "react";

import { NavigationContainer } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";

import LandingScreen from "./components/auth/Landing";

const Stack = createStackNavigator();
export default function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator initialRouteName="Landing">
        <Stack.Screen
          name="Landing"
          component={LandingScreen}
          options={{ headerShown: false }}
        />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

Based official docs of react-navigation you should install other related packages with the below command:根据react-navigation 的官方文档,您应该使用以下命令安装其他相关软件包:

npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view

If you are using expo install these:如果您使用 expo 安装这些:

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM