Convert Expo project to Original React Native project

10,490

After 4 hours, I got the answer..

Had to install exp using npm i -g expo & then used expo eject to detach the project Also I added some fields in app.json for it to work as follows

{
  "expo": {
    "name": "Project",
    "slug": "project",
    "sdkVersion": "18.0.0",
    "privacy": "public",
    "android": {
      "package": "com.example.project"
    }
 }
}

Docs are given here

SideNote: It doesn't create the folder structure like when done using react-native init... It creates android & ios folders respectively.

Share:
10,490
deadcoder0904
Author by

deadcoder0904

I write useful blog posts on the internet. I share them on my Twitter @deadcoder0904

Updated on July 21, 2022

Comments

  • deadcoder0904
    deadcoder0904 almost 2 years

    I did yarn run eject to eject but it gave me this warning

    Warning! We found at least one file where your project imports the Expo SDK
    

    I know I have some modules which use Expo API like this -

    await Expo.Font.loadAsync({
          Roboto: require('native-base/Fonts/Roboto.ttf'),
          Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
        });
    

    Now I want to convert this to React Native Components so that I can eject without any errors so that I get index.android.js & index.ios.js in the root folder like we do while using react-native init example