It’s no secret that having a strong mobile presence is no longer optional.
Worldwide, mobile devices have outgrown desktop use, and the trend toward mobile computing is transforming how organizations communicate with their customers, present their ideas, and reach their business goals.
But simply deciding to establish a mobile presence is just the first step because there is more than one way to reach mobile users.
Specifically, we are comparing NativeScript with React Native to see which of these two mobile app development frameworks for writing natively rendered mobile applications for iOS and Android has more to offer.
For a long time, native mobile apps ruled digital distribution platforms and marketplaces.
Developed in a platform-specific programming language, such as:
- Swift for iOS
- Java for Android,
Platform-specific tools provide seamless access to native platform APIs, and their optimized performance ensures the best user experience possible.
However, native mobile apps are not without their fair share of disadvantages.
Their biggest downside is that it’s not possible to deploy the same code on different platforms.
Let’s say an organization decides to develop an iOS app and hires or outsources software developers, UI specialists, and other professionals. To make the same app available to Android users, the organization would have to hire a new team to port the app to Android.
Not only is it expensive to target multiple platforms with native development, but it can also be very time-consuming.
Tip: By the time the app is finally in both the Google Play Store and the Apple App Store, there might already be many competing apps with great reviews, making it difficult for the newly released app to gain traction.
Of course, making the app available is just the start of a new phase, characterized by ongoing maintenance and feature upgrades, and it goes without saying that it’s far more cost-effective to maintain a single codebase than two.
For these and other reasons, mobile web apps have skyrocketed in popularity in recent years.
Unified development is by far the most important advantage of mobile web apps, but it’s not the only one.
But, again, mobile web apps are not without drawbacks.
While their inherent performance limitations are fairly easy to overlook these days, the fact that they don’t provide access to native components greatly limits what can be achieved with them.
Tip: Users have come to expect native features, such as voice input, push notifications, and GPS, and they will actively avoid mobile apps that don’t support them.
That’s where technologies such as NativeScript and React Native come in.
What is NativeScript?
NativeScript was first released in 2014 by Progress Software Corporation. On its website, NativeScript describes itself as an:
With NativeScript, it’s possible to develop native mobile applications for Android and iOS from a single codebase and enjoy the native-like performance with 100% direct access to all iOS and Android APIs.
Some of the most popular apps created using NativeScript include:
- Strudel – dating app
- BitPoints – cryptocurrency wallet
- Daily Nanny – photo-sharing app for parents and nannies
- Regelneef – energy consumption monitoring app
- Dwitch – food delivery app
Stephen Fluin, Developer Advocate for Angular at Google, says:
“We love working with the NativeScript team because of the way that they empower web developers to leverage their skillsets to build native experiences on mobile,”
Even Payne, Senior Front-End Software Engineer at Netcentric, echoes the same sentiment:
“By using a technology like NativeScript, we gave our Netcentric frontend teams the power to build amazing native mobile apps. This enables us to do more on mobile than we could ever do before,”
What is React Native?
Mark Zuckerberg famously said in an interview at TechCrunch Disrupt:
“The biggest mistake we made as a company was betting too much on HTML5 as opposed to native,”
Just like NativeScript, React Native can be used to create native mobile apps for Android and iOS.
React Native apps render native components and use the same native platform APIs as true native apps do.
Thousands of apps use React Native, including some of the most downloaded and popular apps in the Google Play Store and the Apple App Store, such as:
- SoundCloud Pulse
Fanghao (Robin) Chen, Mobile Lead at Discord, once said:
“Looking back at the past three years, React Native has proven to be extremely successful at Discord and helped drive our iOS user adoption from zero to millions!”
“More specifically, React Native has allowed us to reap the benefits of quickly leveraging reusable code across platforms, as well as develop a small and mighty team.”
NativeScript vs React Native comparison
Now that we’ve introduced both NativeScript and React Native, it’s time to take a closer look at some of the key differences and similarities between them.
Tip: Developers who are already familiar with Angular will find it easier to use NativeScript because of its deep integration with the Angular CLI, router support, code generation, and more.
Likewise, developers who are already familiar with React will be able to easily transition to React Native.
Both NativeScript and React Native allow developers to write using:
However, if you create a new project in React Native you’ll notice that it uses Flow as a default, while NativeScript uses TypeScript. Of course, you can change that if you wish.
NativeScript relies on either Angular or Vue.js for building engaging user interfaces, whose lightweight nature makes it great for mobile development.
Vue.js for the web and NativeScript-Vue are very similar and getting started using NativeScript-Vue is a matter of switching the plugin you include at the start, changing your app instantiation parameters, and writing your front-end templates to use NativeScript modules.
Tip: Both NativeScript and React Native can be debugged using Chrome Developer Tools, also known as Chrome DevTools.
React Native users can also take advantage of React Native Debugger and Reactotron, while NativeScript users sometimes use the Visual Studio Code NativeScript extension.
It’s also possible to use XCode for debugging generated views of apps developed in both of the mentioned technologies.
When it comes to NativeScript, you can directly access all iOS and Android APIs without wasting time writing boilerplate wrappers.
Tip: If you don’t want to write directly against iOS and Android APIs, you can choose from a wide selection of pre-built, open-source, NativeScript plugins, which are available on the NativeScript Marketplace.
React Native doesn’t have a specialized marketplace for plugins, but it’s easy to extend the built-in components it comes with by searching the npm registry for packages mentioning react-native.
Using native modules, developers can write real native code and have access to the full power of the target platform, but it’s rarely necessary to do so since React Native is very capable right out of the box.
At the time of writing this article, React Native is far more popular than NativeScript.
According to this week’s npm stats:
- React Native was downloaded by around 300,000 people
- NativeScript was downloaded only by 10,000 people
When it comes to GitHub stars:
- React Native has 80,000 stars
- NativeScript has less than 20,000
The company behind NativeScript, Progress, has been doing a good job when it comes to making NativeScript better as a technology, but they don’t spend much money on marketing.
React Native vs NativeScript – which to choose?
For those who have already built a web app with Angular, Vue.js or React, the choice between NativeScript and React Native is obvious:
- choose NativeScript if your developers know Angular and Vue.js
- choose React Native if your developers are familiar with React.js
Those who are building a cross-platform mobile app from scratch can choose either way without making a mistake, but there are several compelling reasons to lean toward React Native.
This article is a part of Handbook:React Native Development: A Quick Guide
Don't miss new chapters.
We'll be adding new in-depth content to this handbook very soon. Get it straight to your inbox.
React Native Development: A Quick GuideFollow handbook