i am a beginner to React native.
i read this on https://facebook.github.io/react-native/docs/getting-started that "If you used Expo CLI or Create React Native App to set up your project, you can preview your app on a device by scanning the QR code with the Expo app. In order to build and run your app on a device, you will need to eject and install the native code dependencies from the Getting Started guide"
can someone please explain these lines to me? Also, if we can see our app by using the "expo app" in our phone why do we need to eject it?
Not sure where you took the above quote...
You will need to eject only if you use libraries with native code. Otherwise, it is highly recommended to use expo, it will make your life so much easier (some of the most significant ones are using expo libraries, sharing the app during development, building ipa and apk, getting updates to your users without rebuilding and submitting to the app stores).
Both React Native documentation (https://facebook.github.io/react-native/docs/getting-started) and expo documentation (https://docs.expo.io/versions/latest/expokit/eject/) discuss that.
Update - answering your question in the comment below.
react-native init
, and not within expo + ejecting. Did you try to publish with expo, and to create an apk or an ipa? If not, try it and see how great it is. Now create a project with react-native init
and try to create an ipa and apk. You will understand what I mean.