路线“ x”的组件必须是React组件

时间:2019-01-08 06:03:30

标签: react-native react-native-tabnavigator

这似乎是他们更新API后反应导航的常见问题

看着Fix Error: The component for route 'Home' must be a React component

profilecamera组件都不希望加载到此tabNavigator中。有什么建议吗?

Camera.js

import React, { Component } from 'react';

class Camera extends Component {
    render() {
        return (
            <Text>Camera</Text>
        );
    }
}

export default Camera;

InstaClone.js

import React, { Component } from 'react'
import { View, StyleSheet} from 'react-native' 
import Camera from './components/screens'
import {MainFeed, Login, Profile} from './components/screens'
import { createBottomTabNavigator, createSwitchNavigator, createAppContainer } from 'react-navigation'

const Tabs = createBottomTabNavigator({
    feed: MainFeed,
    Camera: Camera,
    profile: Profile
});

const MainStack = createAppContainer(createSwitchNavigator({
    login: Login,
    main: Tabs
}));

const MainStack = createAppContainer(Tabs);

class InstaClone extends Component {
    render() {
        return <MainStack/>
    }
}


export default InstaClone;

0 个答案:

没有答案