Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native NavigationContainer中的反应本机错误_React Native_React Navigation - Fatal编程技术网

React native NavigationContainer中的反应本机错误

React native NavigationContainer中的反应本机错误,react-native,react-navigation,React Native,React Navigation,由于我是react native新手,所以我正在尝试在react native中构建一个可以导航的简单应用程序 index.js 在我的app/build.gradle中,我添加了以下两个: implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02' 重新启动并使缓存无效。错误是因为Ap

由于我是
react native
新手,所以我正在尝试在
react native
中构建一个可以导航的简单应用程序

index.js

在我的
app/build.gradle
中,我添加了以下两个:

implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'

重新启动并使缓存无效。

错误是因为
AppRegistry.registerComponent
接受返回组件的函数,但您正在传递组件

改变

AppRegistry.registerComponent(appName,MyStack);

您还从错误的位置导入了
createStackNavigator
。您需要像这样导入它:

从'@react navigation/stack'导入{createStackNavigator};

错误是因为
AppRegistry.registerComponent
接受返回组件的函数,但您正在传递组件

改变

AppRegistry.registerComponent(appName,MyStack);

您还从错误的位置导入了
createStackNavigator
。您需要像这样导入它:

从'@react navigation/stack'导入{createStackNavigator};

您错误地导入了createStackNavigator,您应该从'@react navigation/stack'导入{createStackNavigator}。首先看看这是否有帮助。您导入createStackNavigator不正确,您应该从'@react navigation/stack'导入{createStackNavigator}。先看看这是否有帮助。

  "dependencies": {
    "@freakycoder/react-native-helpers": "^0.1.2",
    "@react-native-community/masked-view": "^0.1.6",
    "@react-navigation/native": "^5.0.6",
    "@react-navigation/stack": "^5.0.6",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-dynamic-vector-icons": "^0.2.1",
    "react-native-gesture-handler": "^1.6.0",
    "react-native-improved-text-input": "^0.0.1",
    "react-native-login-screen": "^0.3.6",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-screens": "^2.0.0-beta.8",
    "react-native-spinkit": "^1.5.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-vector-icons": "^6.6.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^0.0.7",
    "babel-jest": "^25.1.0",
    "eslint": "^6.8.0",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.58.0",
    "react-test-renderer": "16.9.0"
  },
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
AppRegistry.registerComponent(appName, () => MyStack);