Saturday, October 24, 2020

React-Native - should use expo or not?



What is Expo?

Expo is a framework that is used to build React Native apps. It is basically a bundle with tools and services built for React Native, that will help you get started with building React Native apps with ease.

So there are two ways to build React Native apps. One using expo, and the other just using plain React Native, without Expo.




Here are some good reasons to use Expo to build your React Native app.

1. Fastest way to build React Native Apps

If you are given a project that needs rapid development, and you have picked React Native to build the cross-platform app, Expo is the best fit for you. With Expo, you can build and deploy React Native apps for both iOS and Android with ease.

2. You don’t need to know Native Mobile coding

With Expo, you will never touch any native iOS or native Android code. This means, you don’t need developers to know any native mobile coding while building apps using Expo. Expo handles all the native code under the hood, and this is not available to the developers who are using it.

Whereas, if you build React Native apps from scratch without Expo, based on what I have seen you will need to use a tiny bit of your native mobile coding skills. Although 95% of the code is shared between iOS and Android, depending on your use-case, you still may have to tweak some native code on both platforms. For anyone who wants to avoid getting into that layer, Expo is the best fit.

3. No Xcode, No Android Studio

If you don’t need to do any native mobile coding using Swift (iOS) or Java (Android), it means you don’t have to ever use tools like Xcode or Android Studio. My least favorite part of being a React Native developer is to deal with all the problems I face while I use both Xcode and Android Studio.

With Expo, there is no need to ever worry about these tools, since you would never need them.

4. Publish Over The Air (OTA) Updates Instantly

A really nice feature that you can utilize while using Expo is Over The Air (OTA) updates. Since all of the code you write to build your app using Expo, is in JavaScript, you can push updates to your app anytime over the air. You would not need app store approvals to do so. The biggest pain point in mobile app development, is going through the app stores to publish updates to your apps.

With Expo, you can quickly publish updates to your app over the app, with ease. There is no native code, hence you don’t need to go to the app store to publish every single update. This is a great feature that comes in handy for rapid development and testing cycles.

5. In-built access to Native APIs

Expo comes with a lot of native APIs out of the box for both iOS and Android. This makes the developers job of adding native features to the app fairly easy. Some of the common native features provided by Expo are, Camera, file system, location, social authentication, push notifications, to name a few. While using Expo, you don’t need to worry about integrating these native features, since they are available to you as a part of the Expo bundle.

The entire list of available APIs with the Expo SDK is linked below:


Why Not Expo?


1. If you are a native mobile developer, or have native developers on the team

The biggest perk of using Expo, is that you don’t have to touch native code. But if you are a native mobile developer or have native mobile developers on your team that is working on building a React Native app, do not use Expo. Because, you won’t be utilizing the native coding expertise while using Expo. This could be frustrating for a developer with native background.

Instead, build React Native apps without Expo. You can build apps using the plain React Native CLI. With this you can always tweak or customize some native components and APIs as needed.

2. Adds another layer of abstraction — Too much magic

Some developers don’t like that Expo adds another layer of abstraction to the already abstracted layer. React Native itself has a layer of abstraction and it is essentially a wrapper around the native iOS and Android components. Now adding another layer of abstraction with Expo, is not something some developers maybe comfortable with. This means, there is a lot of stuff happening under the hood, that we don’t have control over. In my perspective, this is not a real problem. If the ultimate goal is to build a solid React Native app, the magic is actually a good thing. But this is totally subjective.

3. Not all iOS and Android APIs are available yet

The official Expo documentation states that not all iOS and Android APIs are available yet. Features like bluetooth, In-App purchases are not available with Expo yet. Make sure to read to verify all the features you are trying to build are available with Expo, before you decide one way or other.

4. Can’t pick your choice of Push Notification service

With Expo, you don’t get to pick the push notification service like Firebase. You have to go with what comes out of the box, which is One Signal. If this is something that could be a problem to you, then Expo is not for you.




references:

https://medium.com/@adhithiravi/building-react-native-apps-expo-or-not-d49770d1f5b8


No comments:

Post a Comment