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.
Native Apps vs Cross-platform mobile apps
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.
Cross-platform libraries rely on standard web tools like HTML, CSS, and JavaScript, providing native experiences by accessing the native features.
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.
Ionic vs React Native: Which one is more popular?
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.
What is better: Ionic or React Native?
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.
Ionic - A Hybrid Framework
Ionic: what is it?
Ionic Framework is an open-source UI toolkit for building mobile and Progressive Web Apps (PWAs) apps using web technologies like HTML, CSS, and JavaScript. It provides mobile-optimized web technology-based components as well as native APIs using Capacitor and Ionic Native. It was created in 2013, by the Drifty Co. The original version was released in 2013, built on top of Angularjs and Apache Cordova.
In 2019 they launched a version with support for multiple front-ends, including React.js.
Today you can build an Hybrid mobile application in Ionic with Angular, React.js, Vuejs, or even with just plain JavaScript.
Now let’s take a look at its advantages:
Pros:
Has a good documentation, since it's a company specialized in building tools that help companies and developers to make mobile applications.
These tools are well understood by web developers since it uses webview to render the application (letting the developers use day-to-day technologies like HTML, CSS, and JavaScript).
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:
Cons:
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.
React Native - Learn once, write anywhere.
React Native: what is it?
With React Native, developers can build mobile applications for Android and iOS platforms using JavaScript, but they can also implement features with native code. It enables cross-platform builds by providing platform-agnostic native components that map into the platforms’ native UI building blocks. It was created in 2015 by Facebook and it is used in many of its products, as for example, the marketplace section of Facebook's application.
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:
Pros
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:
Cons:
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.
What is the difference between React Native and Ionic?
Both allow developers to build mobile applications that can run on different platforms and use JavaScript as the principal language. However, Ionic's approach is more "web-like". This means that the application runs on a web browser wrapped in an SDK, to access the native functionalities.
React Native uses three bridges, UI Thread, Layout Thread, and Javascript Virtual Machine, to trade information by sending messages to each one.
It uses the JavaScript language to map the native capabilities. This allows developers to build mobile applications that are then translated into native code. On the other hand, the Ionic Framework uses web technologies (HTML, CSS, and JavaScript) to build the applications. It is possible to use Ionic Native and/or Capacitator to connect JavaScript and native abilities like accessing the user location, Bluetooth, camera, etc.
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.
When to use Ionic or React Native?
Since Ionic works with web technologies (HTML, CSS, and JavaScript) it fits well in a team that has no background in the native world.
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.
Top comments (1)
thanks! that was meaningful content :)