【问题标题】:Native Base Content is empty when using React Navigation 5使用 React Navigation 5 时,Native Base Content 为空
【发布时间】:2020-07-27 04:39:33
【问题描述】:

我正在尝试使用 React Navigation 5Native Base 创建一个基本应用程序。但似乎 React Navigation 覆盖了 Native Base。内容不会呈现简单的文本。

/**
 * @format
 */
import React from 'react';
import 'react-native-gesture-handler';
import { AppRegistry } from 'react-native';
import NavigationInitializer from './route/NavigationSetup';
import { name as appName } from './app.json';
import { LogBox } from 'react-native';
import { Root, Container, Content, Header, Text, Footer } from 'native-base';
LogBox.ignoreAllLogs(); // remove unnecessary warnings
//  This is useful when there's a noisy warning that cannot be fixed, like those in a third-party dependency.

// AppRegistry.registerComponent(appName, () => NavigationInitializer);


AppRegistry.registerComponent(appName, () => () =>
    <Container>
        <Header>
            <Text style={{ color: "black" }}>
                HEADER
            </Text>
        </Header>
        <Content style={{ backgroundColor: "red" }}>
            <Text style={{ color: "black" }}>
                This is Content Section
            </Text>
        </Content>
        <Footer>
            <Text style={{ color: "black" }}>
                This is Footer Section
            </Text>
        </Footer>
    </Container>
);

【问题讨论】:

    标签: reactjs react-native react-navigation native-base react-navigation-v5


    【解决方案1】:

    好的。我通过升级 React native 和 native base 解决了这个问题。

    https://github.com/GeekyAnts/NativeBase/issues/3204#issuecomment-667596807

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-13
      相关资源
      最近更新 更多