函数作为React子元素无效(React-Native)

时间:2018-08-10 18:17:32

标签: react-native react-navigation

我不能全神贯注,不明白为什么会收到此警告,我在App.js中使用了两种导航器(选项卡导航器和堆栈导航器),我似乎无法使其正常工作

App.js

export const Tabs = TabNavigator({
      'FormScreen': {
        screen: FormScreen,
        navigationOptions: {
          tabBarLabel: 'Contact Us',
          tabBarIcon: ({ tintColor }) => <Icon name="ios-contact" type="entypo" size={28} color={tintColor} />
        }
      },
      'ListScreen': {
        screen: ListScreen,
        navigationOptions: {
          tabBarLabel: 'Contact List',
          tabBarIcon: ({ tintColor }) => <Icon name="list" type="entypo" size={28} color={tintColor} />
        }
      }
    });
    export const NavigationScreen = () => {
      return StackNavigator(
        {

          Tabs: {
            screen: Tabs,
            navigationOptions: {
              gesturesEnabled: false
            }
          }
        },
        {
          headerMode: "none",
          mode: "modal"
        }
      );
    };   
    export default class App extends React.Component {
      render() {
        return (
         <NavigationScreen/>);
      }
    }

0 个答案:

没有答案