I’m trying to create a new react-native app. This is my first project. I’m not able to see the icons in expo tab.
Project structure:
constants/icons.js
app/(tabs)/_layout.jsx
import { View, Text, Image } from 'react-native';
import { Tabs, Redirect} from 'expo-router';
import { icons } from '../../constants';
const TabIcon = (icon, color, name, focused) => {
return (
<View>
<Image
source={icon}
resizeMode="contain"
tintColor={color}
className="w-6 h-6"
/>
<Text className={`${focused ? 'font-psemibold' : 'font-pregular'} text-xs`}>
</Text>
</View>
)
}
const TabsLayout = () => {
return (
<>
<Tabs
screenOptions={{
tabBarShowLabel: true
}}
>
<Tabs.Screen
name="home"
options={{
title: 'Home',
headerShown: false,
tabBarIcon: ({color, focused}) => (
<TabIcon
icon={icons.home}
color={color}
name="Home"
focused={focused} />
)
}
}
/>
</Tabs>
</>
)
}
export default TabsLayout
But I don’t see home.png getting loaded in the emulator
Clearing the cache and doing build/pre-build in expo didn’t help. I’m not sure how to proceed on this.
Please let me know if you have any further questions.
TIA