I used create-react-native-app my-project but I want to use icons from @expo/vector-icons
import { Ionicons} from '@expo/vector-icons';
export default function App(){
return <Ionicons name={Platform.OS === 'ios'?"ios-happy-outline":"md-happy"} size={100}/>}
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.
Icons should be visible on my User interface
You can use react-native-vector-icons from https://oblador.github.io/react-native-vector-icons/
first Install the Dependency (react-native-vector-icons) by
npm install react-native-vector-icons
Create assets/fonts directory in android/app/src/main
Once you create the fonts directory copy all the font files from node_modules/react-native-vector-icons/Fonts into it
Now in App.js you can react-native-vector-icons like below
import React from "react";
import {Text, View, StyleSheet, TouchableOpacity} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
// https://icons.expo.fyi for icons
export default function toDoItems({item, pressHandler}){
return(
<TouchableOpacity onPress={()=> pressHandler(item.key)}>
<View>
<Icon name="rocket" size={30} color="#900" />
<Text style={styles.item}>{item.text}</Text>
</View>
</TouchableOpacity>
)
}
const styles= StyleSheet.create({
item : {
padding : 30,
borderColor : 'black',
borderWidth : 1,
borderStyle : 'dashed',
marginVertical : 20,
}
})