loksan
loksan

Reputation: 177

Vector icons in expo snack

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.

Upvotes: 0

Views: 896

Answers (1)

Ketan Ramteke
Ketan Ramteke

Reputation: 10651

Import MaterialIcons like this:

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

For more: MaterialIcons

Upvotes: 1

Related Questions