use icon in tab bar react native
const screenOptions = (route, color) => {
let iconName;
switch (route.name) {
case 'Home':
iconName = 'home';
break;
case 'Browse':
iconName = 'appstore-o';
break;
case 'Library':
iconName = 'folder1';
break;
default:
break;
}
return <Icon name={iconName} color={color} size={24} />;
};
const TabNavigator = () => {
return (
<Tab.Navigator
screenOptions={({route}) => ({
tabBarIcon: ({color}) => screenOptions(route, color),
})}>
{/* rest remains same */}
</Tab.Navigator>
);
};