反应本机 - 错误 -> 路由优先应在使用堆栈导航器时声明一个屏幕



React Native-路线"第一"应该声明一个屏幕,不确定!为什么会出现此错误?

请同时找到随附的目录屏幕截图。

在此处输入图像描述

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View
} from 'react-native';
const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,n' +
    'Cmd+D or shake for dev menu',
  android: 'Double tap R on your keyboard to reload,n' +
    'Shake or press menu button for dev menu',
});
import { StackNavigator } from 'react-navigation';
import Register from './src/container/Register';
import MobileVerification from './src/container/Verification/MobileVerification';
import SignUpOtp from './src/container/SignUpOtp/SignUpOtp';


const Navigation = StackNavigator ({
  First: {
    Screen: Register
  },
  Second: {
    Screen: MobileVerification
  },
  Third: {
    Screen: SignUpOtp
  }
});
export default Navigation;

你应该声明screen而不是Screen

const Navigation = StackNavigator({
    First: {
        screen: Register
    },
    Second: {
        screen: MobileVerification
    },
    Third: {
        screen: SignUpOtp
    }
});

相关内容

  • 没有找到相关文章

最新更新