ReactNative Eject Explained

Viewed 26123

I literally started reading about ReactNative an hour ago and am reading this git readme https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md

Next I googled about it and found this link which seem to be explaining it but not to me novice in web, react, or react-native https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md

Can someone explain to me as if I am 2 years old what is the meaning of eject? I keep hearing term "ejected project" but I cannot wrap my head around it.

2 Answers

My understanding is that when you run the "create-react-native-app" (or "expo init" now) you are basically adding the Expo library on top of React Native.

I think the main reason for using Expo is to get your app up and running quickly. I think the main reason to eject is that eventually you might need to do more complicated customization with native code and need more control, etc. Here is a better explanation of Expo vs React Native CLI to bootstrap your app:

https://levelup.gitconnected.com/expo-vs-react-native-cli-a-guide-to-bootstrapping-new-react-native-apps-6f0fcafee58f

When you eject you are returning to the same state as if you did not use Expo to setup your app (native ios/android projects will be generated, etc.)

Here are a few other links that helped me understand: http://www.reactnativeexpress.com/environment

https://docs.expo.io/versions/latest/expokit/eject/

Related