我正在尝试制作一个可以导航到 TabNavigator 的 StackNavigator。但是有一个错误说;“ route 的组件必须是 React 组件”。
TabNav 不是文件夹,我只想在用户登录后调用它。这样,标签将显示我认为。而且,我只是按照教程来做这个。对不起,伙计们,我只是一个新手。
这是我的代码
应用程序.js
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View, } from 'react-native';
import { StackNavigator, TabNavigator } from 'react-navigation';
import Login from './components/Login';
import ManageOrder from './components/ManageOrder';
import SpecialOrder from './components/SpecialOrder';
import categories from './components/categories';
export default class App extends Component {
render() {
return (
<RootNav />
);
}
}
const RootNav = StackNavigator({
Login: {
screen: Login,
},
TabNav: { screen: TabNav },
});
const TabNav = TabNavigator({
categories: {
screen: categories,
},
ManageOrder: {
screen: ManageOrder
},
SpecialOrder: {
screen: SpecialOrder
},
});