Search code examples
react-nativeexponative-base

Struggling to set up nativebase in a React Expo project


I have tried so many different ways to set nativebase up with expo and am still having an issue. At the moment I'm using the
Getting Started documentation found on the nativebase website.

I first create a new app with expo using

expo init myapp

Then I install nativebase using

npm install native-base --save

Then I finally install the font

expo install expo-font

I even copy the App.js found in the getting started documentation, and after I start the app and try to run it on an emulator I face the below error

Unable to resolve "@expo/vector-icons/Fontisto" from "node_modules\native-base\dist\src\basic\IconNB.js" Failed building JavaScript bundle.

What am I missing? Coming from .NET world this whole process with dependencies is so painful...

*Edit 1

I'm sure someone will make mention of the fact that the error message mentions @expo/vector-icons and I have not installed that. When running before I install this package I get that error, and after I install the mentioned package I still face the exact same error.


Solution

  • Please try with this version of native base :

    npm i --save-exact [email protected]
    

    Expo should release a version with that version .

    Hope it helps. feel free for doubts