Reputation: 121
I am trying to put a badge head on a tab bar in React Native but it is not working.
Below is an example of my code:
These are my module versions :
"@react-navigation/native": "^6.0.14",
"@react-navigation/bottom-tabs": "^6.4.1",
This is my code :
<Tab.Screen
name={'ApprovalTab'}
component={ApprovalScreen}
options={{tabBarBadge:3,
tabBarBadgeStyle:{color:'red'}}}
/>
Upvotes: 1
Views: 223
Reputation:
try this code
import { Ionicons } from '@expo/vector-icons';
<Tab.Screen
name={'ApprovalTab'}
component={ApprovalScreen}
options={{
tabBarBadge: 0,
tabBarIcon: ({ color, size }) => (
<Ionicons name="home" color="red" size={30} />
),
}}
/>
hope this will help you!!
Upvotes: 1