React Native- Route'First'应该声明一个屏幕,不确定!为什么会出现此错误?
请同时找到dir的附件截图。
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;
答案 0 :(得分:0)
您应该声明screen
而不是Screen
。
const Navigation = StackNavigator({
First: {
screen: Register
},
Second: {
screen: MobileVerification
},
Third: {
screen: SignUpOtp
}
});