React导航再生器默认异步



在下面的链接中有一些我的代码的屏幕截图(与React Navigation官方教程相同(

emu-error

代码

我的json文件是:

{
  "name": "test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.9",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^3.11.0",
    "styled-components": "^4.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.5.0",
    "@babel/runtime": "^7.5.1",
    "babel-jest": "^24.8.0",
    "jest": "^24.8.0",
    "metro-react-native-babel-preset": "^0.55.0",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

有人知道如何解决这个问题?

请使用此代码进行导航

import {
  createStackNavigator,
  createSwitchNavigator,
  createAppContainer,
} from 'react-navigation';
// Auth screens
import Login from './Screen/Login'
import Signup from './Screen/Signup'
// Auth stacks
const AuthStackLogin = createStackNavigator({
  Login,
  Signup,
},{ 
  headerMode: 'none' 
}
);
export default createAppContainer(createSwitchNavigator(
  {
    AuthStackLogin: {
      screen: AuthStackLogin
    },
  },
  {
    initialRouteName: 'AuthStackLogin'
  }
));

相关内容

  • 没有找到相关文章

最新更新