While looking to develop mobile apps with other than the native toolsets, I found myself evaluating Ionic and React Native as two of the most common alternatives. Both have a large community of passionate developers, are used heavily in large enterprises, and can lay claim to many popular consumer apps.
In this post, I will try to compare — Ionic and React Native framework. Both technologies allow you to build mobile apps for iOS as well as Android. After extensive research, I would say these two are great frameworks because they allow developers to quickly prototype and publish apps on multiple platforms with single source code.
The reason why I am writing this is that it is often asked — “What platform should I select for my enterprise app development?”. Though it is for most of the time very specific, we can still layout (or at least try!) some general guidelines to better decide.
Great! So how do these technologies differ, which one is the best choice for your next mobile project? Let’s take a look…
What is Ionic 4?
Ionic is a complete open-source SDK for hybrid mobile app development created by Max Lynch, Ben Sperry and Adam Bradley of Drifty Co. in 2013. Ionic provides tools and services for developing hybrid mobile apps using Web technologies like CSS, HTML5, and Sass. Apps can be built with these Web technologies and then distributed through native app stores to be installed on devices by leveraging Cordova.
So, in other words — If you create Native apps in Android, you code in Java. If you create Native apps in iOS, you code in Obj-C or Swift. Both of these are powerful but complex languages. With Cordova (and Ionic) you can write a single piece of code for your app that can run on both iOS and Android (and windows!), that too with the simplicity of HTML, CSS, and JS.
What Is React Native?
React Native currently supports both iOS and Android and has the potential to expand to future platforms as well. In this blog, we’ll cover both iOS and Android. The vast majority of the code we write is cross-platform. And yes: you can really use React Native to build production-ready mobile applications! Some example: Facebook, Palantir, and TaskRabbit are already using it in production for user-facing applications.
Hybrid Mobile Apps vs. Native Apps: A Popular Debate
Before we start, here’s something important you should consider. Ionic is a framework for hybrid mobile app development and React Native is a cross-platform framework to build native apps.
To decide which one is better for Cross-Platform Mobile App Development, I chose to define some parameters, on the basis of which I will try to make a clear comparison. And, those are:
- Language Stack
- Do not repeat yourself(DRY)
- Rich pre-styled Component Library
- User Interface
- Ecosystem / Third-Party Libraries
- Market and Community
- Accessing Native Device Features
- Supported Platforms
- Popular Apps
1. The Language Stack
With this metric, I want to explore which framework utilizes which programming languages and offer what benefits:
The solid side of React Native that makes it best among the other three frameworks in terms of PL is that it allows writing a few components in Swift, Objective-C or Java when developers require them. Utilizing native modules and libraries in React Native applications, you can manage computationally heavy operations like video handling or image editing.
Ionic framework: It uses HTML5, CSS, and JS to develop and run applications, and requires Cordova wrapper to access native platform controllers. Utilizing IONIC, you can also use TypeScript that improves the quality of the code.
Here is how you can rank these frameworks based on the advantages offered by their programming languages:
- React Native (React)
- Ionic Framework (Angular)
2. Do not repeat yourself (DRY)
With this metric, I want to explore how much of the code we write can be re-used for both platforms.
Ionic: Awesome re-usability! The “wrapped web app” concept ensures that you can easily re-use your code — you’re just building a wrapped web app in the end. The great component library of adaptive components (i.e. automatically styled for the platform the app runs on) also helps.
React Native: Also compiles to native defaults but only provides a basic set of components to start with. You have to style most of them on your own, hence more work is required to achieve appropriate styles on both platforms. Generally, code can be re-used though (since you still only use one language and libraries like Redux need no adjustment).
Here is how you can rank these frameworks based on the Code Reusability
- Ionic Framework
- React Native
3. Rich pre-styled Component Library
How easy is it to build beautiful UIs? Do you have to create and style a lot of components (UI elements) on your own or do you have a rich suite of pre-built ones? Are the components adapting to the underlying platform automatically? That’s what this metric is about.
Ionic: Ionic in its core is a big set of pre-built (and pre-styled) components. The compiler/ toolchain which yields a native app is also part of the Ionic package (handled via its CLI) but it utilizes other packages like Cordova or Capacitor. The components provided by Ionic automatically adapt to the platform the app runs on and therefore, Ionic makes the creation of beautiful, native-looking apps a breeze!
React Native: A decent set of built-in components is provided but a lot of them need to be styled by you. And they’re non-adaptive, instead — just as with Flutter — you get alternatives for both operating systems. That requires adjustments in your code, where you have to choose, use and style widgets conditionally.
Here is how you can rank these frameworks based on the pre-styled Component Library
- Ionic Framework
- React Native
This metric is the most important one and speaks for itself — how do the apps made in different frameworks perform from a run-time performance perspective?
React Native: The performance it provides is very similar to native applications as it renders code elements specifically to the native APIs. React additionally allow developers to use native modules written in native languages to write code for complicated operations. However, they can’t be reused across two platforms; their main purpose is to provide higher performance.
Ionic: In terms of performance, Ionic loses the game. Its performance isn’t as similar to React Native or flutter offers since it utilizes web technologies to render an application. This approach significantly decreases the speed. Also, it doesn’t utilize native components and tries to create a native look and feel by using web technologies.
The upside of Ionic is its quick testing process that runs instantly in a browser that streamlines the development process.
Ionic offers a poorer performance among these 3 as it’s a wrapped web app in the end. But this is often misunderstood! “Worse” sounds extremely bad but “worse” doesn’t actually mean “horrible” or even “bad”. Instead, you got worse performance than with the other approaches. In fact, on the devices we got these days, your app will probably run more than smooth! If you only (imaginary!) got 100fps instead of 105fps — would you notice a difference? You wouldn’t, so keep Ionic in your mind for your next app!
Here is how you can rank these frameworks based on the performance they offer:
- React Native
5. User Interface
Users judge apps within the first few seconds of usage and that’s why GUI of an app must be engaging while being easy — let’s see what these frameworks offer:
React Native: React Native modules associated with native UI controllers, which gives amazing user experience that is very close to native apps. It additionally utilizes the ReactJS library with extensive UI elements and streamlines the UI development.
Ionic: Ionic UI doesn’t utilize native elements at all and renders everything in HTML and CSS. Then it applies Cordova to give native mobile experience. Angular components that accompany the framework also enable Ionic apps look like the native ones.
Here is how you can rank these frameworks based on the UI they offer:
- React Native
6. Ecosystem / Third-Party Libraries
What does the ecosystem look like? Is it easy to find help (on Stackoverflow etc) and are there enough third-party libraries available to add that one feature your app needs?
Here is how you can rank these frameworks based on the Ecosystem / Third-Party Libraries
- React Native
7. Market and Community
Having a dynamic ecosystem is something worth being thankful for — but it matters how popular is an option? Let’s see:
Ionic: It is the second most popular framework after React. It empowers developers to build native mobile apps in the fastest possible way. Ionic has a huge community support, as well as a great marketplace where you can find a lot of starters and templates to jump start any app from Uber to Spotify.
Here is how you can rank these frameworks based on their industry recognition and reliability:
- React Native
8. Accessing Native Device Features
Your mobile apps most likely need access to some native device feature like the camera or GPS. How easy is it to get that access? And how easy is it for relatively new features (e.g. AR APIs provided by Android/ iOS)?
Ionic: Ionic uses Cordova or its own solution, Capacitor, to give you access to native device features. It provides a very decent set of packages to access common native device functionalities like the camera. You can also write your own wrappers around native functionalities and then include them in your code of course. Also, Ionic/Cordova and/or Angular plugins are very stable, and update readily with platform updates.
React Native: Being the most popular solution, you find a rich set of third-party packages as well as some built-in APIs for accessing native platform functionalities. Relying on third-party packages (which you mostly have to do) of course has the disadvantage that the core maintainers of that package might quit, hence the support is not on the same level as it is with Ionic or NativeScript.
Here is how you can rank these frameworks based on the Accessing Native Device Features :
- React Native
9. Supported Platforms
React Native: Android 4.1+ , iOS 8+
Ionic: Android 4.4+ , iOS 8+ , Windows 10
10. Popular Apps
React Native: Facebook, Instagram, UberEats, Airbnb (they later removed RN from usage. Read More here — Why Airbnb left React Native)
Ionic: JustWatch, Pacifica, Nationwide and many more.
React Native: Completely open-source frameworks. Engineers can utilize this system and their libraries for free.
Ionic: It is a free open source framework for developing cross-platform mobile applications. But, the organization offers its Pro Development Environment which is paid. The company guarantees that Ionic Pro accelerates the development process.
With React native any 3rd party library that you might use could get outdated or become incompatible with your updated codebase. Hence, maintainability remains a big issue.
As opposed to React native, you would only require maintaining one single app in Ionic(you had to maintain iOS and Android builds in React native).
However, the biggest challenge with the maintainability of Ionic apps is that the framework itself is undergoing continuous changes with frequent release cycles on Ionic and Cordova.
If it requires you to deliver high performing apps which are closed in giving the native performance of users, then React Native will be the best option for you. On the other hand, if your project requirement allows you to deliver a decent performing app which looks like native to users then you can always go with the Ionic framework. It all depends on the project requirement. In case of any further questions, feel free to comment or get in touch.
This article was originally published at Enappd.