Vector icons in expo snack

675 views Asked by At

I want to add icons to my react native snack expo app.

I tried using this:

import MaterialIcons from '@expo/vector-icons'

And when I added the component <MaterialIcons name="delete" /> in my main functional component, it throws me an error.

I am using the online code editor called snack expo for building my app. Can someone help me how to use vector icons in the snack expo?

Many thanks for considering my request.

1

There are 1 answers

0
Ketan Ramteke On BEST ANSWER

Import MaterialIcons like this:

import { MaterialIcons } from '@expo/vector-icons';
// then use it
<MaterialIcons name="delete" />

For more: MaterialIcons