New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to show Badge when use TabNavigator from 'react-navigation' #2560
Comments
I don't believe that's currently part of the functionality of the library. Something you could do is, via |
Here's a crude example of how I'm adding a badge to a tab in TabNavigator. I'm passing a prop called export default TabNavigator({
// ...other tabs go here
ConversationsTab: {
screen: ConversationsNavigator,
path: 'conversationstab',
navigationOptions: ({ screenProps }) => ({
tabBarIcon: ({ focused }) => (
<View style={styles.tabIconWrapper}>
<Image
focused={focused}
style={styles.tabBarIcon}
source={images.conversationsIcon}
/>
{ screenProps.newConversations
? <Text style={styles.badgeStyles}>{ screenProps.newConversations }</Text>
: null
}
</View>
)
})
}
}); |
@richardgirges may i know the Styling u have used? |
Pinging OP @zcwhdz since this issue has not been active for a while, and it's related to an old version of the lib. Please let me know if you want this to remain open (does it still happen in the latest version?); if I get no answer in the next 7 days I will close it. Moreover the code snippet @richardgirges provided is the same one I use in my own code; it may be worth doing a small PR to docs to add it. |
Hi there @zcwhdz , In an effort to cleanup this project and prioritize a bit, since this issue had no follow up since my last comment I'm going to close it. If you are still having the issue with the latest version (especially if it's a bug report) please check the current open issues, and if you can't find a duplicate, open a new one that uses the new Issue Template to provide some more details to help us solve it. |
Hey, this is the styling used. position: 'absolute', |
how to show Badge when use TabNavigator from 'react-navigation'
The text was updated successfully, but these errors were encountered: