Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between create-react-native-app and Expo? #153

Closed
philggg opened this issue Apr 7, 2017 · 39 comments
Closed

Difference between create-react-native-app and Expo? #153

philggg opened this issue Apr 7, 2017 · 39 comments

Comments

@philggg
Copy link

philggg commented Apr 7, 2017

Sorry if this is not the best forum, but what is the difference between using create-react-native-app and using the Expo toolset? And why would someone pick one or the other?

@ide ide changed the title Difference between creat-react-native-app and Expo? Difference between create-react-native-app and Expo? Apr 7, 2017
@ide
Copy link
Member

ide commented Apr 7, 2017

Good question, the short answer is that create-react-native-app is the quickest way to start a new React Native project. It uses the Expo client and some of the Expo devtools but not all of them. For example, you don't need to create an Expo developer account to use CRNA and we've found it's faster to get started with CRNA than with XDE (the Expo development app).

Since CRNA projects run in the Expo client, you do have access to most of the Expo APIs such as native maps, audio, OpenGL, and more. There are a couple of exceptions like push notifications that only Expo projects can use, but there are many more similarities than differences between CRNA projects and Expo projects.

CRNA was also designed to give you several paths forward as your app grows. The three paths are:

  • Use Expo: You actually can open a CRNA project with the Expo XDE app if you want all the features of Expo including push notifications and IPA / APK files for the App Store / Play Store.
  • Eject to ExpoKit: ExpoKit is a native library that includes React Native and the Expo APIs. This path creates Xcode and Android Studio projects with ExpoKit so that most Expo APIs keep working if you were using them before. You then build IPA / APK files the way you would as any other native app.
  • Eject to bare React Native: This path gives you a plain React Native project with separate Xcode and Android Studio projects. All modules that come with React Native will work but Expo APIs won't work (use ExpoKit above for that) because this is bare React Native.

Note that when you eject, CRNA won't manage upgrades for you so you're responsible for upgrading React Native.

@ide ide closed this as completed Apr 7, 2017
@philggg
Copy link
Author

philggg commented Apr 7, 2017

I notice that the file structure for a CRNA is different than both typical react native and Expo generated apps. (Especially the roots of the apps are different. (eg: No index.ios.js) Also the way the root file is setup is different. (eg: CRNA apps don't register their entry component, but instead export them).
Is there any documentation of all of this?
thanks
Phil

@anp
Copy link
Contributor

anp commented Apr 7, 2017

Not yet!

@philggg
Copy link
Author

philggg commented Apr 7, 2017

In that case I would advise others getting started to do what I did. Create sample apps in all three environments (React native, CRNA, and Expo). Then open them all up at the same time in Atom to look at the file structure of each one. That way when you are flipping between the documentation of all three you will have a reference to what is going on.
cheers

@kristojorg
Copy link

Does one need to eject to ExpoKit in order to use the expo push notifications?

@ide
Copy link
Member

ide commented Apr 8, 2017

@kristojorg To use Expo Push Notifications you'll need to use Expo's devtools (XDE or exp, docs here: https://docs.expo.io) which will enable your project to send push notifications.

If you eject to ExpoKit, Expo push notifications won't work (as of April 2017) for technical reasons (e.g. Expo doesn't have the push certificate for your ejected app needed to send push notifications). Instead you should use the native iOS & Android APIs to get the device token and send push notifications manually.

@kristojorg
Copy link

kristojorg commented Apr 8, 2017

@ide Thank ! Somehow the push notifications just started working... before I was getting: The recipient "ExponentPushToken[xxx]" isn\'t associated with any device.

For the record, I am still somewhat confused as to if there is a difference between running a CRNA via command line yarn start:ios and via opening through XDE, and how that relates to push notifications... but I'm glad it is working now!

And also thank you so much for all the work here and through React Native : )

@ide
Copy link
Member

ide commented Apr 10, 2017

CRNA projects are designed not to depend a lot on Expo services. For example you don't need an Expo developer account. When you use XDE you now have an Expo account and are developing an Expo project so you can use Expo services.

@lethevinh
Copy link

if eject to expoKit , i cant run command "react-native run-android" ?

@ide
Copy link
Member

ide commented Apr 14, 2017

@VinhDev With ExpoKit you run your Android project from Android Studio / Gradle / whatever you'd use for a typical Android project. The only react-native CLI command that is supported is react-native link. These are more docs on ExpoKit: https://docs.expo.io/versions/latest/guides/expokit.html

@Noor0
Copy link

Noor0 commented Jun 30, 2017

how does expo build app with native android/ios SDKs?

@tamanneupane
Copy link

Project created from expo toolkit doesnot have ios file. Should i create file my self? or what is the correct method?

@darentanDZ
Copy link

Same question here. Why it does not have index.ios.js and index.android.js? Feel a bit confused while following tutorials online.

@ide
Copy link
Member

ide commented Jul 27, 2017

You can just start writing code in App.js. If you want to have separate files for each platform, you can make App.ios.js and App.android.js but it's more common to share the files by default.

@JuanLuisGarciaBorrego
Copy link

When installing the new version of react-native and being forced to use Expo, I notice that when making some simple change, the reload is slower.

Are you the same?

@ide
Copy link
Member

ide commented Jul 27, 2017

Expo shouldn't be slower. If you're using exp or XDE, those set up an exp.direct tunnel URL by default which goes over the internet. This is slower but lets you share your project with collaborators or devices that aren't on the same WiFi network. You can set exp or XDE to use a LAN IP URL instead if all your devices are on the same network and can access each other.

@Albinzr
Copy link

Albinzr commented Aug 6, 2017

Can we add third party lib which needs to add code in xcode and android studio when using Expo?

@brentvatne
Copy link
Member

@xahon
Copy link

xahon commented Sep 8, 2017

Am i able to run app on ios if i eject to expokit?

@Mythrim
Copy link

Mythrim commented Oct 17, 2017

How to handle Expo Xde in case of ubuntu?

@Lammmas
Copy link

Lammmas commented Nov 1, 2017

@Mythrim you don't need to use the XDE IDE, you can use the command line

@HasanAlyazidi
Copy link

Thank you for CRNA and Expo,

Apps that use only Expo can't launch first time with no internet connection, it requires Internet, so the JS bundle and assets are downloaded then the app runs normally, is that situation the same in CRNA apps?

Do CRNA apps run with no Internet in the first launch?

@lawrenceong001
Copy link

Hello

I'm totally new to react and reactnative, was wondering if someone can provide guidance. I would like to build an iOS and Android app, on a Windows laptop. Is it possible to compile the iOS app this way? If so please provide some insight on this.

Tks
Lawrence

@sohaibjaved44
Copy link

sohaibjaved44 commented Dec 3, 2017

Hey @lawrenceong001 I have created app using expo. So all I did is followed this so now I'm able to run my app without emulator/simulator all I need to do was to keep my windows machine and mobile device in the same network.
After that you may need to go with some starter kit / boilerplate so launching starter kit like this with expo is currently a challenge for me too, I'm figuring it out.

@lawrenceong001
Copy link

Thanks @sohaibjaved44, I was wondering if I can also deploy to Apple appstore without a Mac too.

@cloud-seek
Copy link

Can i use Expo camera instead of React-native camera?

@imakin
Copy link

imakin commented Jan 13, 2018

@JordiGoPython yes you can

@smithaitufe
Copy link

In summary, which is preferrable?

@brentvatne
Copy link
Member

@dankovacek
Copy link

I found this thread after running into problems getting react-native-camera to work with react native 0.52, after starting project with create-react-native-project. I'm not alone, it it appears:

react-native-camera/react-native-camera#272

I'm now pursuing expo camera.

@Mifayo
Copy link

Mifayo commented Mar 11, 2018

so if i had to chose
which one i should chose ?

@smithaitufe
Copy link

@Mifayo
In my experience, simply stick to react-native init.

Save yourself from headaches.

@soletan
Copy link

soletan commented Mar 16, 2018

According to @anp there is no official tutorial on how to properly eject CRNA to build non-debugging versions for on-device deployment and this obviously hasn't changed for nearly one year. Having spent months on creating app using CRNA and now I have to study code of react-native to get an idea of how to fix the missing index.ios.js/index.android.js-issue? There is no tutorial and that's it?

Is there any ongoing development on supporting CRNA at all? Why care for it at all if ejecting was working some day in the past but no one has taken care of this path working for that long time. Maybe just fix the docs explaining that using CRNA might render wasted time ... won't take a day to add this explanation. And it would help devs from even trying CRNA in the first place. AFAIU it would reduce manpower required to develop Expo App, too ... WinWin for everyone.

UPDATE: To clarify the issue to myself. I tried creating vanilla project on same host running react-native init test && cd test && npm i && react-native run-ios ... build succeeded, iOS simulator comes up, app is starting and failing due to missing index.js ... this time it's neither indes.ios.js nor index.android.js ... WTF. I see, it's a 0.x, but it should get negative version numbers for that.

UPDATE: Found some example index.ios.js in README on native-base-shoutem-theme and found it quite similar to the existing App.js. So tried copying App.js into index.ios.js ... downloading bundle failed again due to not having found any index.ios.js in any of the roots (listing the folder I was copying the file to right before). I really don't get this chaos.

@anp
Copy link
Contributor

anp commented Mar 16, 2018

@soletan I'm a bit confused about what you're having issues with -- can you open an issue with more details on what you're trying to achieve?

@soletan
Copy link

soletan commented Mar 17, 2018

Well, sorry for hijacking this thread most probably.

I was basically having issues with problems mentioned in this thread before regarding missing index.ios.js files in a CRNA, even after ejecting it. I was referring to you due to your instant answer to that post considering the lack of some documentation.

My app still isn't running after ejecting it. The lack of index.js had to be fixed manually. Can't remember having read anything about that in any of the docs. And docs are quite distributed. In one place eject is claimed to ask questions about how I want to build things, but that didn't happen in my case. SO indicates use of react-native upgrade being required. Stumbled over probably requiring to invoke react-native link in a different place. Eventually I'm stuck with built app claiming to fail due to using Expo APIs. Guess I have to keep gathering more documentations or find a system I'm willing to pollute with quite unstable WSL so I can put several GB of Linux distro on it just to run exp on a Windows computer.

Claiming CRNA to be a good start for creating react-native applications is pretty misleading. Okay, might be a good start, but it's a terrible end as all time saved in the beginning is wasted steps before finish line.

@allanesquina
Copy link

I have a question about Privacy/Security. As mentioned in docs, I need to send my bundle to Expo build it and even my keystore. I wonder to know who is Expo and what kind of trusts do I have.
About the docs, IMO, Expo should not be at the react native quick start section since it is a company that offer support as business model. It`s a joke.

@dsp1589
Copy link

dsp1589 commented Apr 9, 2018

will apple approve CRNA apps? looks like its hot code push through expo xde slug url.

@brentvatne
Copy link
Member

@dsp1589 - yes they will. same thing as other react native apps, and millions of cordova apps, etc.

@expo expo locked as off-topic and limited conversation to collaborators Apr 9, 2018
@brentvatne
Copy link
Member

@soletan - thanks for the info, a new issue for that would be great.

@allanesquina - you also don't need to send your keystore if you want to build it locally - https://github.com/expo/expo#standalone-apps. additionally, just use react-native init if you want. nobody is forcing you to use this.

About the docs, IMO, Expo should not be at the react native quick start section since it is a company that offer support as business model. It's a joke.

I don't understand your argument here, but if you feel very strongly about it please open a PR on react-native with your suggested changes to the getting started guide and your arguments for why this should be done and we can certainly discuss. Either way this thread is not the right place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests