Mobile apps have exploded in popularity over recent years. The introduction of the iPhone 3G in 2008 spawned a new industry overnight. App development is now an industry that generates more than $34 billion in revenue.
To reach all potential users, developers need to develop applications for (at least) the two leading platforms: Android and iOS. Since the development for the platforms is time-consuming and requires different expertise (Swift/iOS vs. Java/Kotlin), cross-platform solutions were introduced over the years. Among them, Unity, Ionic, Cordova, and React Native. Those solutions ideally allow you to develop once and run your apps on both platforms.
In this post, we’ll do an analysis of two of these solutions: Cordova and React Native. In addition, we’ll discuss what the appropriate use cases are for each of them so you can decide which best fits your needs.
Cordova Native Plugins
React Native Introduction
React Native vs. Cordova Comparison
Both React and Cordova allow creating feature-rich, sophisticated, and performant applications. However, each shows its strengths and weaknesses in different areas. When you choose a framework to base your application on, it’s important to remember the pros and cons of each.
More on the React Native Architecture
In addition, React Native developers have added the option of splitting React components via hooks. Each hook groups related data into a sub-component, thus allowing more flexibility in managing and deploying components.
App Immutability Across Platforms
What does this heading mean? Well, we can basically sum it up with one question. That is, “Will my app look the same on both Android and iOS?” Cordova runs in the browser.
Since the Android web view is powered by Chrome and the iOS web view is powered by Safari, there might be some rendering differences between the two. Buttons might not look the same, menus will look slightly different, etc.
In addition, since Safari and Chrome support different HTML5 features, you need to make sure you don’t accidentally use a feature that isn’t evergreen.
In Cordova, you can create one codebase and use it across both platforms.
In React, this is a bit tricky. Although you can use mostly the same code, specific implementation will be needed for elements that exist only in one of the two platforms. This makes development in React potentially longer and the maintenance harder for sure, as you need to manage at least two repositories. One for each system. Each with its own build and deployment process.
Lastly, it’s worth mentioning that if you need to develop a web version for your app, Cordova provides this capability out of the box, while with React Native, you’ll need to create a different codebase.
Regarding the learning curve, Cordova is easy to grasp for anyone who has ever done any kind of web development.
On the other hand, React Native requires familiarity with React concepts first to make good use of the framework. We can say with a fair amount of confidence that if you’ve never worked with React, the learning curve for React Native will be steeper.
Both React Native and Cordova use the Chrome Dev Tools to inspect an application and debug it.
The one thing that is lacking for React Native (without a plugin) is a drill-down of the source code to the React component level. On the other hand, if you use React Native, you get hot reloading out of the box. In other words, if you make a change in your code, it will be automatically reflected in the debugger.
In regards to UX, React Native provides a better user experience. Since the React component can be easily converted to native components, a React Native app gives a user experience that is very close to a “real” native app.
Cordova provides a user experience that’s closer to an online software as a service (SaaS) application.
Mobile app development is a huge market. It has a lot of financial potential for application developers. However, developing for two platforms is hard and time-consuming. This is why cross-platform development tools were developed. Two of the most popular tools are Cordova and React Native—each with its respective strengths and weaknesses.
If you’re already familiar with React and want to provide the most “native-like” UX for your users, React Native is the right choice for you. However, if you want to maintain a single codebase, are familiar only with regular web development, or need a web version of your app as well, Cordova is a better choice for you.
Either way, there are parts of the process that remain the same. In order to publish your app, you need to register with Google Play and the iPhone App Store. Thoroughly test your app with manual and automatic tests. Create a DevOps pipeline for building and publishing new versions. Lastly, make sure that users love your application.
This post was written by Alexander Fridman. Alexander is a veteran in the software industry with over 11 years of experience. He worked his way up the corporate ladder and has held the positions of Senior Software Developer, Team Leader, Software Architect, and CTO. Alexander is experienced in frontend development and DevOps, but he specializes in backend development.