deadcoder0904
deadcoder0904

Reputation: 8683

Convert Expo project to Original React Native project

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

Upvotes: 3

Views: 23173

Answers (1)

deadcoder0904
deadcoder0904

Reputation: 8683

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.

Upvotes: 7

Related Questions