小编yun*_*oto的帖子

错误:无法注册导航器。您是否使用“NavigationContainer”包装了您的应用程序?

我正在学习使用此视频https://youtu.be/1hPgQWbWmEk进行编码,我完全按照那个人所做的去做,但是当我运行expo start然后在 Web 浏览器中运行时,会出现以下错误:

无法注册导航器。您是否使用“NavigationContainer”包装了您的应用程序?

到目前为止,这是我的代码

import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';

import {navigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import { createMaterialTopTabNavigator } from 'react-navigation-tabs'

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>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: …
Run Code Online (Sandbox Code Playgroud)

javascript react-native react-navigation expo

2
推荐指数
1
解决办法
3288
查看次数

标签 统计

expo ×1

javascript ×1

react-native ×1

react-navigation ×1