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