React Native-error - > Route First应该在使用堆栈导航器

时间:2017-10-18 22:37:41

标签: react-native react-router react-redux

React Native- Route'First'应该声明一个屏幕,不确定!为什么会出现此错误?

请同时找到dir的附件截图。

enter image description here

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;

1 个答案:

答案 0 :(得分:0)

您应该声明screen而不是Screen

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