React Native-无法使TabNavigator正常工作

时间:2018-07-04 23:30:54

标签: reactjs react-native native react-navigation tabnavigator

我安装了react-navigation,并使Switch Navigator可以工作,但是我无法使Tab Navigator正常工作。编译时,出现以下错误:

  

警告:纯JavaScript React中不建议使用isMounted(...)   类。相反,请确保清理订阅和待处理   componentWillUnmount中的请求以防止内存泄漏。

然后,当我消除错误时,我得到了一个空白屏幕。我的编译器未检测到任何语法错误。

import React, { Component } from "react";
import { View, StyleSheet } from "react-native";
import { MainFeed, Login, Camera, Profile } from "./components/screens";
import { SwitchNavigator, TabNavigator } from "react-navigation";

const Tabs = TabNavigator({
    feed: MainFeed,
    camera: Camera,
    profile: Profile


});

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

class InstaClone extends Component {
    render(){

        return <MainStack/>;

    }
}

export default InstaClone; 

0 个答案:

没有答案