React Native doesn't suck anymore: Expo to the rescue

React Native doesn't suck anymore: Expo to the rescue

Introduction

React Native is an amazing cross-platform app development framework, with its own set of pros and cons. But in the past few weeks, I have seen many negative reviews from people on Twitter (especially web developers) who used it a few years ago. I am new to react native so it was quite fascinating to hear this. Why would anyone hate it so much that they are recommending others not to use it? I was so happy that I could build cross-platform apps and learn React, which will be beneficial when I eventually get into web development.

In this blog, I'll try to showcase my experience with react native, especially using Expo, and give a new perspective to those who have tried it before.

The most common complaints

"The developer experience is not as good as the web"

Yes, I completely agree with this, but isn't it because it's app development which is inherently different from web development? Personally, the most frustrating thing about react native is building the APK file. This is due to the Android build step, not react native.

Especially with Expo, it is very simple. Just create a project using npx create-expo-app, install the expo go app on your phone and you're good to go. You don't have to set up the Android or iOS development environment. But this method has its limitations, you cannot use packages with native code with Kotlin/java or Swift/Objective-C code in it.

Back in the day what developers used to do when they want to use a package with native code in it is to eject their app from Expo. or create an Expo Prebuild which generates the custom native code on your pc, but you need to set up the Android and iOS development environment to continue with this method and it's not really the best experience. But I still see developers opting into Expo Prebuild as soon as they want to use a native package or make changes to the native code. But I would strongly advise against it as there is something better.

Introducing expo config plugins, a simple way to customize native code without ever touching it! If you are planning to use a package with native code, chances are that they already have a config plugin for expo, all you have to do is mention it in your app.json file and you're done. This saves a lot of time and lets you avoid making mistakes while editing the native code. You have to build a development client using EAS Build which is quite similar to the expo go app but it has your native code built into it. Accessing native features is pretty simple too using expo modules.

Also, with the new expo router, I would say that the experience is very close to that of web development. You get a website, an Android app, and an iOS app just by writing your code once. Building universal apps has never been so simple. Expo router also helps you in deep linking to your app so you don't have to worry about that either. The fact that I fix a bug on my app on my phone and push it to my users is a testament to expo's developer experience.

"React native is slow"

React native might technically be slower than its counterparts but does it really matter when your users probably won't notice the difference? Popular apps such as Discord and Swiggy (Indian Uber Eats) are built using react native but from my personal experience, they don't feel slow at all.

React native now also has Skia which is a high-performance 2D graphics engine, which brings its performance on par with its counterparts in terms of speed and rendering capabilities.

"It has limited native functionality"

Expo modules make it easy to add any native features to your app. I have never found this to be a limiting feature when building my apps using react native.

"lack of community support"

The community is not the most active one but it is pretty good in my opinion. Many companies such as Shopify and Callstack are actively improving react native.

Conclusion

I believe that React Native is a great cross-platform app development framework. Despite some negative reviews, my experience with React Native, especially using Expo, has been quite positive. While it may not offer the same developer experience as web development, it is important to remember that app development is inherently different. With Expo, building cross-platform apps has never been easier, and the new Expo config plugins make customizing native code a breeze. Furthermore, React Native's performance has improved with the addition of Skia, and it offers a wide range of native functionality through Expo modules. Overall, I believe React Native is a great option for cross-platform app development, and recommend it to others.