I'm trying to add MaterialCommunityIcons to my react native / expo project. I added this…
- User
I'm trying to add MaterialCommunityIcons to my react native / expo project. I added this line but it's grayed out by vscode. Do I need to do npm install or something:
// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
import Ionicons from '@expo/vector-icons/Ionicons'; import { type IconProps } from '@expo/vector-icons/build/createIconSet'; import { type ComponentProps } from 'react';
export function TabBarIcon({ style, ...rest }: IconProps<ComponentProps['name']>) { return <Ionicons size={28} style={[{ marginBottom: -3 }, style]} {...rest} />; }
- Assistant
The issue you're experiencing is related to Visual Studio Code indicating that the imported module is not being used in your current file. However, this does not necessarily mean there is an error in the import itself. In this case, if you want to use
MaterialCommunityIcons, you'll need to actually utilize it in your code similarly to how you used .