Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

native-base icon not showing in Header

Tags:

react-native

Here I am using native-base latest version and using all the methods props but still my icons are not appearing in the header

import React, { Component } from "react";
import {
    View,
    Text,
    StyleSheet
} from "react-native";
import {Header,Icon} from 'native-base'

class HomeScreen extends Component {
    static navigationOptions = { header: null }
    render() {
        return (
          <View style={{flex:1,backgroundColor:'#3q455c',width:"100%"}}>
          <Header
           placement="left"
           leftComponent={{ icon: 'menu', color: 'white' }}
           centerComponent={{ text: 'MY TITLE', style: { color: 'white' } }}
           rightComponent={{ icon: 'home', color: 'white' }}
           />

          </View>
        );

}}
export default HomeScreen;

const styles = StyleSheet.create({
    container: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center'
    }
});

Here the header function is not showing in the header component

like image 513
Aoudesh Jaiswal Avatar asked Nov 28 '22 05:11

Aoudesh Jaiswal


1 Answers

To get around this I did:

react-native link
react-native run-android 

and the icons showed.

like image 84
ionyekanna Avatar answered Feb 07 '23 15:02

ionyekanna