Convert Expo project to Original React Native project

空扰寡人 提交于 2020-01-23 19:01:06

问题


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


回答1:


After 4 hours, I got the answer..

Had to install exp using npm i -g exp & then used exp detach 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.



来源:https://stackoverflow.com/questions/44748213/convert-expo-project-to-original-react-native-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!