react-nativereact-native-vector-icons

How can use expo icons in react native app created by create-react-native-app my-project


I used create-react-native-app my-project but I want to use icons from @expo/vector-icons

Code

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

export default function App(){

 return <Ionicons name={Platform.OS === 'ios'?"ios-happy-outline":"md-happy"} size={100}/>}
 

Actual result

Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.

Expected result

Icons should be visible on my User interface


Solution

  • You can use react-native-vector-icons from https://oblador.github.io/react-native-vector-icons/