Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6208

React-Native Icon at createBottomTabNavigator does not appear

$
0
0

I am fairly new to React-Native and I am trying to implement a bottom navigation bar.

I have succeeded to do this, however, I can not seem to get the Icons working.

Code that I am using

import React from 'react';

import {createAppContainer} from 'react-navigation';
import {createBottomTabNavigator} from 'react-navigation-tabs';
import {NewsPage} from "./src/components/NewsPage";
import {TaskOverview} from "./src/components/TaskOverview";
import {Agenda} from "./src/components/Agenda";
import {Wiki} from "./src/components/Wiki";
import {Profile} from "./src/components/Profile";
import {Icon} from 'react-native-elements'

const TabNavigator = createBottomTabNavigator({
    TaskOverview: {
        screen: TaskOverview,
        navigationOptions: {
            tabBarLabel: 'Example title',
            tabBarIcon: ({tintColor}) => (
                <Icon name="rocket" color={tintColor} size={24}/>
            )
        },
    },
    NewsPage: {
        screen: NewsPage,
        navigationOptions: {
            tabBarLabel: 'Example title2',
            tabBarIcon: ({tintColor}) => (
                <Icon name="rocket" color={tintColor} size={24}/>
            )
        },
    },
});

const AppContainer = createAppContainer(TabNavigator);

export default class App extends React.Component {
    render() {
        return <AppContainer/>;
    }
}

Result that I am getting

It shows me bottom navigation but for the icon, it literally shows me a question mark.

What have I tried

  • Instead of Icon, I have tried working with IonIcon, but this did not solve this issue for me.
  • I tried different Icon names.

I hope someone can give me some insight.


Viewing all articles
Browse latest Browse all 6208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>