React Native Expo vs CLI (Pure React Native)
React Native init:
- You can add native modules written in Java/Objective-C (probably the only but the strongest one)
- Needs Android Studio and XCode to run the projects
- You can't develop for iOS without having a mac
- The device has to be connected via USB to use it for testing
- Fonts need to be imported manually in XCode
- If you want to share the app you need to send the whole .apk / .ipa file
- Does not provide JS APIs out of the box, e.g. Push-Notifications, Asset Manager, they need to be manually installed and linked with npm for example
- Setting up a working project properly (including device configuration) is rather complicated and can take time
- Setting up a project is easy and can be done in minutes
- You (and other people) can open the project while you're working on it
- Sharing the app is easy (via QR-code or link), you don't have to send the whole .apk or .ipa file
- No build necessary to run the app
- Integrates some basic libraries in a standard project (Push Notifications, Asset Manager,...)
- You can eject it to ExpoKit and integrate native code continuing using some of the Expo features, but not all of them
- Expo can build .apk and .ipa files (distribution to stores possible with Expo)
- You can't add native modules (probably a gamechanger for some)
- You can't use libraries that use native code in Objective-C/Java
- The standard Hello World app is about 25MB big (because of the integrated libraries)
- If you want to use: FaceDetector, ARKit o Payments you need to eject it to ExpoKit
- Ejecting it to ExpoKit has a trade-off of features of Expo, e.g. you cannot share via QR code
- When ejecting to ExpoKit you are limited to the react native version that is supported by ExpoKit at that point in time
- Debugging in ExpoKit (with native modules) is a lot more complicated since it mixes two languages and different libraries (no official Expo support anymore)
Expo & "Create React Native App"
Create React Native App has been replaced by the Expo-CLI. If you’ve already created your project with CRNA, you can read about migrating from CRNA to Expo-CLI here.
Expo CLI is a tool based on CRNA, made by the same team.
It has all the same features, plus some additional benefits.
Like CRNA, Expo CLI does not require an Expo user account.
The create-react-native-app command will continue to work.
When you write code in Expo you write React Native code. Expo has two main pieces:
1) expo-cli: a developer tool for creating projects, viewing logs, opening on your device, publishing, etc.
2) The Expo client: an app on your phone that lets you open your projects while you're working on them, without needing to go through XCode or Android Studio, and also lets other people view them too! And if you publish it through expo-cli, people can access it at any time through the Expoclient on Android or on iOS if signed in to the same account it was published with. Lastly, we also make it possible to build standalone apps so people don't have to use the Expo client to open it, and you can distribute to the app store and play store if you like.
This is important because with React Native you can always drop down to native code. This is incredibly helpful sometimes but it comes at a cost: you need to send people your binaries if you want them to test them, someone on the other side of the world can't just tap a link to open it while you're working on it and you can't just publish it with one click for someone to access it similar to how you would in a browser.
However, if you must find that you absolutely drop down to native, you can use ExpoKit to continue using the native APIs that Expo gives you while having the same level of control as you would in any native project. "ExpoKit is an Objective-C and Java library that allows you to use the Expo platform and your existing Expo project as part of a larger standard native project."
Expo is kind of like Rails for React Native. Lots of things are set up for you, so it’s quicker to get started and on the right path.
Here are some of the things Expo gives you out of the box that works right away:
Support for iOS and Android
You can use apps written in Expo on both iOS and Android right out of the box. You don’t need to go through a separate build process for each one. Just open any Expo app in the Expo Client app from the App Store on either iOS or Android (or in a simulator or emulator on your computer).
Push notifications work right out of the box across both iOS and Android, using a single, unified API. You don’t have to set up APNS and GCM/FCM or configure ZeroPush or anything like that. We think we’ve made this as easy as it can be right now.
This can take a long time to get set up properly yourself, but you should be able to get it working in 10 minutes or less on Expo.
All Expo apps can be updated in seconds by just clicking Publish in XDE. You don’t have to set anything up; it just works this way. If you aren’t using Expo, you’d either use Microsoft Code Push or roll your own solution for this problem
Images, videos, fonts, etc. are all distributed dynamically over the Internet with Expo. This means they work with instant updating and can be changed on the fly. The asset management system built-in to Expo takes care of uploading all the assets in your repo to a CDN so they’ll load quickly for anyone.
Without Expo, the normal thing to do is to bundle your assets into your app which means you can’t change them. Or you’d have to manage to put your assets on a CDN or similar yourself.
Easier Updating To New React Native Releases
But no native modules…
The most limiting thing about Expo is that you can’t add in your own native modules without detaching and using ExpoKit.
I hope I could sum up the most important points. Please feel free to add additional points.