'React tab navigation 6 : adding icon from assets folder
I'm new to react native. I'm trying to figure out how I can add an icon from my assets folder to the nav bar, and remove the label.
For the moment, react navigation displays an empty square and route name as label.
My code :
export default function Tabs() {
return (
<Tab.Navigator
screenOptions={({ route }) => {
tabBarIcon: ({ focused, color, size }) => {
HOW TO ADD ICON FROM ASSET FOLDER ?
};
}}
>
<Tab.Screen name="Community" component={Community} />
<Tab.Screen name="Explorer" component={Explorer} />
<Tab.Screen name="Home" component={Home} />
<Tab.Screen name="Menu" component={Menu} />
<Tab.Screen name="Messenger" component={Messenger} />
<Tab.Screen name="Notifications" component={Notifications} />
</Tab.Navigator>
);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
