Kureev / react-native-navbar

Navbar component for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Put image instead of title

munkhorgil opened this issue · comments

commented

How to put image instead of title ?

var img = { render() { return <Image source={require('../images/logo.png')} />; } };

<NavigationBar title={img} statusBar={statusBar} style={styles.navbarContainer} />

Failed prop type: Invalid prop title

I'm afraid you can't use plain objects as React components.
Consider using class TitleComponent extends React.Component { render() { ... } } instead and let me know if it helps.

commented

What about using StackNavigator ?

What about it? How is it related to the topic?

@Kureev @munkhorgil I also want to add image instead of the title in the app, is that possible to do that using this library?

👋 @Luckygirlllll!

Sure, you can pass ReactElement to title property of react-native-navbar:

<Navbar title={<Image source={...}} />

@Kureev Is that possible to add text and image for the title?