DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Asad Anik
Asad Anik

Posted on

React Native VS Expo

Expo and React Native are awesome tools to create apps. The only important thing is to understand the demands of your projects. Then it will be easy to choose which one to use.

React Native CLI β‡’

The main advantage of using React Native is that you can share code between iOS and Android. Instead of that, you have to write and maintain two completely separate codebases. Moreover, you can also use many times the parts of your web app.

There are four situations in which React Native CLI is your best choice.

  • Working prototypes
  • Apps with streamlined UI
  • Basic cross-platform apps
  • Apps without heavy use of native APIs
  • Applications with complex User Interface
  • Building utilities such as battery monitors
  • Apps built especially for a single OS
  • Apps when you don’t have many animations

Advantage

  • You can include native modules coded in Java/Objective-C
  • Developing .apk and .ipa files is much easier than with Expo
  • Reusable code & pre-built components
  • Simplified UI
  • Third-party plugin support
  • Modular architecture

React Native made a big push in mobile application development, but it has some downsides. Recently Airbnb and Udacity shared their experience in React Native. They have concluded that this platform has plenty of benefits. But you can’t use it to build any kind of mobile apps.

Disadvantage

  • It requires Android Studio and XCode to run the projects
  • You can’t build an app for iOS without having a Mac
  • There is no need to connect the device via USB to use for testing
  • There is no need to import fonts by hand in XCode
  • If you want to send your app to somebody you need to send the whole .apk / .ipa file
  • You have to install and link with, for example, npm Push-Notifications, Asset Manager
  • Setting up a working project in a correct way is rather difficult and can take time
  • It requires a high level of configuration
  • It requires a basic knowledge of Android and iOS folder structure

Expo CLI β‡’

Now what I want to start with is the cons for Expo or the limitation, because they have quite a few. And if your app needs a specific thing, you have to check whether Expo supports it or not. So that you could know you shouldn’t consider using Expo in the first place.

Advantage

  • No need to link and lots of libraries
  • Better development experience
  • Easier to upgrade to new versions
  • Easier to deploy to Apple / Google Store
  • Mobile UI: It’s much easier to view on both Android and iPhone using barcode scanning. It is also easier to view with online iPhone and Android simulators.
  • Over the air updates
  • Easier to setup deep linking
  • Expo SDK is available: Expo apps ship with Expo SDK. And it opens up lots of features to benefit you.Β BarcodeScanner,Β MapView,Β ImagePicker, and many more are available for your use.
  • Expo involves generating an IPA file for iOS and an APK file for Android
  • Ejecting: The last thing that is good to mention is that at any point you can eject out. It’s nice to know that you are not locked in and you have other options. For example, you’re using Expo and realize that you need a library out of Expo, then you can eject. Doing this, this feature is unpacking all the Native code into iOs and Android folders. Also, it is splitting the App.js file into App.js and index.js. My general experience is so much better comparing with React Native. I spent less time setting things up, and getting libraries, and React Native to work. And I had more time programming the apps, building the views, the logic. I love working with Expo. But if your app needs some specific features and packages, it’s better to choose React Native.

Disadvantage

  • Limitations: They have a nice page that onlines some of the limitations, so I’m not going to go through the entire thing. I recommend reading thisΒ listΒ before you make a decision. But I want to highlight the biggest problem, that you cannot use native modules. I mean by that a project, where you’re can run a React Native link for, for example, vector icons.
  • Libraries: The vector icons library is a very popular React Native library. You can’t use them if you:
    1. need to change some of the iOs projects or Android projects
    2. touch CocoaPods or a Gradle
    3. write some Swift code or Kotlin code So anywhere we need to link something, it doesn’t work in Expo CLI
  • Some iOS and Android APIs are not available: The other thing is to note, some of the device’s APIs are not supported. That’s a big thing as well: no Bluetooth, no Web RTC. But many features are in progress of development now, so it’s a good way to check a list ofΒ feature requests.

As you see, both ways have their pros and cons. So which one is better to use? It depends. Whenever you needs to access also your real native application development programming, then you can choose React Native CLI otherwise when your time to build or develop fast time delivery and not more futuristic features, so go for Expo CLI.

Top comments (0)

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›