Search code examples
react-nativeexpofont-awesome-5

Native base Latest Version not work in EXPO snack


I have just created a new snack and add native base library with the instructions provided by Native base documentation for expo:

Here is the instructions i have followed:

// At the top of your file
import { Font } from 'expo';
import { Ionicons } from '@expo/vector-icons';

// Later on in your component
async componentDidMount() {
  await Font.loadAsync({
    'Roboto': require('native-base/Fonts/Roboto.ttf'),
    'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
    ...Ionicons.font,
  });
}

But It shows Error As Unable to resolve module FontAwesome5.js enter image description here

Please Suggest me some solution for the same

Here is my Snack Link for the same.

https://snack.expo.io/@simransingh/native-base

Thanks.


Solution

  • Hi I just found the solution for the same ,

    It's because of FontAwesome5 not loaded properly ,

    You can import it from @expo/vector-icons

    Here is the working snack:

    https://snack.expo.io/@simransingh/native-base