Search code examples
reactjsreact-nativereact-icons

Make sure to start component names with a capital letter


Problem

I'm having an error using react-icons trying to use it:

Image

in header.js I checked for uncapitalized first letter but all of them were correct:

  <View style={styles.headerIcon}>
<TouchableOpacity  onPress={openMenu} >
  <MdMap />
</TouchableOpacity>
  </View> 

import 

What I have tried

Deleting react-icons then re-installing it yarn add react-icons --save.

Doing what the error says Make sure to start component names with capital letter.

And what I have tried didn't work.

I have fixed the error from the help of the answer below that worked for me.


Solution

  • It appears this package cannot be used in react-native (component packages typically don't unless they specify compatibility with RN), and you should consider switching to something like react-native-vector-icons.