If you're thinking about building a mobile app, this article is for you. I mean, almost everyone has a smartphone these days. Can you name a better way to engage with your users and make their lives easier?
According to a study conducted by Gartner, 70% of all enterprise software interactions are expected to occur on mobile devices by 2022.
However, the mobile ecosystem is complex. In order to have an app published on Play Store or App Store, you may need to have two different development teams: one for Android and another for iOS, which can lead to a cost increase.
To address this struggle, cross-platform tools started to pop up. In this article, we're going to compare Ionic and React Native, which are the most relevant libraries. But first, let me introduce you to the cross-platform world.
Today, there are plenty of ways of having a mobile application as a final product. The most popular solution is building it as native, by using the native language of each platform. The alternative is to choose a cross-platform tool that I will mention later on.
Using native code leads to superior performance, but has the downside of having two teams to handling the product: one for the Android ecosystem and another for iOS.
The hybrid path has the advantage of increasing the speed of mobile development, by having just one project for both platforms and offering UX consistency across channels. After this short introduction, let's go further in detail about the two most used tools to build cross-platform mobile applications: Ionic and React Native.
Both have a wide community around them, with a strong adoption by big companies and mobile applications used by a very large number of customers. This is what we can perceive from npmtrends data:
As seen in the graphic above, Ionic had way more downloads than React Native in 2017. This occurred because Ionic is older than React Native. At that time, it was more mature, ready to be used in mobile development, with less bugs and more stable. After 2019, Facebook put more effort into making React Native a stable library, by updating it frequently, using it in their own products, and presenting showcases about the results.
Ionic also has plenty of apps that were released to both Play Store (Android) and App Store (iOS). The Untappd App is one of the examples.
While with React Native, we can check the Marketplace feature, that is part of Facebook app.
Both of them have different characteristics and different ecosystems. Let’s talk about each of them individually to better understand how Ionic and React Native work and its pros and cons.
In 2019 they launched a version with support for multiple front-ends, including React.js.
Now let’s take a look at its advantages:
Has a good documentation, since it's a company specialized in building tools that help companies and developers to make mobile applications.
Makes it easy to port the code into a Progressive Web App (PWA), since all the code is built to run in a web browser. Ionic just requires a few extra steps to be able to have one PWA.
Although it has benefits, we can also encounter some challenges in the way, like the ones listed below:
Since the organization behind the framework makes a living from it, besides the fremium features, there are also premium ones that you can only use if you pay an extra cost.
Ionic is built on top of the “web browser”. The application code can't easily access the native functionalities.
Developers can also build TV applications with React Native. This means that with a few extra steps, it is possible to deliver applications for the Apple TV and Android TV.
Now, lets dive into some benefits of React Native:
Massive community around the ecosystem. Right now, there are impressive numbers on GitHub repo facebook/react-native. This means that it's very likely for developers to find answers to issues or problems they're facing.
Ability of being integrated into existing native apps, like showed in this presentation. Besides that, it's also possible to build native modules, making your mobile application's look and feel as smooth as a native application.
React Native is translated to native code, with the benefit of achieving 60 frames per second. This gives the user the impression of a native app - not slow at all!
It allows developers to deliver applications for Apple TV and Android TV, with only a few extra steps.
Now let's take a look at the issues we've encountered as below:
Since there's a big private company behind it, new tools are released according to their own needs. However, the community is free to extend the desired features, to achieve what is necessary for both Android and iOS native technologies.
React Native is still beta. Yes, you read it right. Although it was created five years ago, the Facebook team still didn’t have the confidence to bump a "production" release of it. It may sound like: "be aware of the possible risks".
This often leads to breaking changes in tools and dependencies between versions. But hey, Gmail was almost 5 years in beta and it worked pretty well.
Ionic and React Native also have a different technology stack. With Ionic, developers are building one application on top of the browser, and have the ability to use all the npm packages available to React.js.
React Native has a more restricted stack since the code is translated to native code. Despite this, the React Native community is very large, with lots of ready to use libraries that help the mobile application development.
With Ionic, you will have the capability to make great mobile applications, accessing native features like GPS, maps, or audio. These features are ready to be deployed into both Play Store and App Store, with the same effort and expertise that will require to build a web site.
React Native is easily addressed by developers with prior iOS or Android development knowledge. The learning curve for a React developer to understand and debug a React Native application is higher than with Ionic. However, React Native stands with the golden triumph of accessing the native functionalities of the mobile devices, allowing your mobile application to deliver a more native look and feel.