1
votes

I'm using react native and I am trying to use Material-UI icons.

I have npm installed both @material-ui and @material-ui/icons.

I have included:

import AddIcon from "@material-ui/icons/Add";

To the top and I have the icon in my return as:

<AddIcon />

However I'm getting the error

Invariant Violation: View config getter callback for component 'path' must be a function (received 'undefined'). Make sure to start component names with a capital letter.

Removing the <AddIcon/> removes the error but then obviously the icon doesn't show.

I'm using react-native and expo. I'm not using an emulator or android studio. I'm coding this project in Visual Studio Code.

2
I am awaiting for anyone to answer. Tangled with the same issue. Have you resolved this?Saurabh Saluja
Sorry, I ended up not using material-ui for the final projectMarnie Rodriguez

2 Answers

1
votes

Try this library where in you can show material icons. This library provides range of icons. https://youtu.be/BjrlrGy_HaY

This includes installation of vector icons npm package and demonstrates the uses of vector icons library.

1
votes

You can use a library installed by default in expo Change Ionicons with the name of icon you want & always check docs ! https://docs.expo.io/guides/icons/

import { Ionicons } from '@expo/vector-icons';