DEV Community

Cover image for React Native vs NativeScript: Comparison
tomgrabski for Pagepro

Posted on • Updated on • Originally published at pagepro.co

React Native vs NativeScript: Comparison

Somewhere in the middle of our previous article about the pros and cons of React Native and Xamarin, I promised to deliver another comparison at the end of the week. And here it is – React Native vs NativeScript comparison.

What is cross-platform development?

Cross-platform development is a way to build mobile applications from single codebase instead of creating separate applications for specific operating systems. Applications made that way are native-like and have several advantages over native applications, like:

  • Availability on every mobile device – on the contrary to native apps that are built for one specific platform only, cross-platform apps work everywhere.
  • Bigger audience – there is a chance that you have a limited budget so you would have to decide between reaching out solely to Android users or iOS fans. But when you decide to go with the cross-platform app, the necessity to choose disappears.
  • Cost-effectiveness – you can hire one developer instead of two, and changing or fixing the code of one application is also cheaper than maintaining two separate apps.
  • Shorten time to market – TTM means the time from the idea to the working product (like Minimum Viable Product). And while building two separate apps takes a lot of time, cross-platform development is 50% faster than native development. Therefore, you can get your first clients (or at least honest feedback) quickly.

If you want to learn more about the differences between cross-platform apps and native apps, we recommend our article on this subject.

Cross-platform development frameworks

The next step is to choose the proper framework for your mobile application. Among them are:

Although our first choice is React Native, we want you to make well thought out decisions about the framework. Because of that, we prepared a few comparisons between React Native and other frameworks:

What is React Native?

Facebook created React Native as an open-source framework based on JavaScript. With RN, you can build native mobile applications for both Android and iOS.

If you want to learn more about React Native, we recommend reading our React Native Guide.

What is NativeScript?

NativeScript, as same as React Native, is an open-source framework that helps developers build apps on the Android and iOS platforms. NativeScript apps are created with JavaScript or by any other JavaScript-related language like TypeScript. NS also supports frameworks like Angular and Vue.js.

NativeScript allows for direct access to all native platform APIs on both iOS and Android. Thanks to it, you can build fully native apps like they were developed in Xcode or Android Studio.

Additionally, NativeScript developers can re-purpose third-party libraries from CocoaPods, Maven, and npm.js without using wrappers.

Companies using NativeScript

  • Deloitte Digital
  • Hulu
  • PUMA
  • Sennheiser

React Native vs NativeScript: Head-to-head

React Native NativeScript
Programming language JavaScript JavaScript
Created by Facebook Progress
Supported platforms Android, iOS, Web Apps Android, iOS
Hot Reload YES YES (LiveSync)
Release date 2015 2015

React Native vs NativeScript: Comparison

Application size

If your mobile application will consist of complex business logic, then you should go with React Native, because the application size will be compact. On the contrary, complex mobile apps built with NativeScript are usually of considerable size. And keep in mind that high-speed internet connection isn’t available everywhere, which may cause terrible experience from using such an app.

Code sharing

The general rule is that the more complex and custom the application is, the smaller the possibility of sharing codebase. However, React Native, and NativeScript applications can share up to 90% of the code.

There is also one crucial factor that influences the code-sharing percentage – the number of used native-platform components. The bigger that number is, the smallest part of the code can be shared.

Community, popularity and support

If it were a popularity contest, React Native would win indisputably. The main reason is that the Facebook developers are behind RN, and they are wildly popular around the programming world. Just take a look at numbers from GitHub, Google Trends, StackOverflow, and Stackshare. 

React Native on GitHub NativeScript on GitHub

Google Trends

React Native vs NativeScript: Google trends overview

React Native and NativeScript on Stackshare

2020 Developer Survey by Stack Overflow. (NativeScript isn’t even mentioned.)

React Native vs NativeScript: Stack Overflow screenshot

React Native vs NativeScript: Stack Overflow screenshot

All these numbers mean that if you choose React Native to build a mobile app, it will be easier to:

  • Get unconditional help from the online community.
  • Find and hire developers. 
  • Find components or learning resources.

Developer environment and tools

There is no IDE (integrated development environment) explicitly created for React Native development. Because of that, you can use your favourite code editor. And while it’s great news, you should remember that you are on your own when it comes to setting up everything. 

NativeScript makes it easy to set up the environment – everything you need is a single line of code. Moreover, there is a special debugging plugin for those who use Visual Studio Code. As a developer, you can use it for variable inspection, breakpoints and other everyday tasks.

Both frameworks, however, allow developers to use Chrome Developer Tools for debugging.

Learning curve

Both platforms take advantage of JavaScript, so it’s a piece of excellent news for frontend developers. And both are perceived as relatively easy to learn.

However, there are some differences.

On the one hand, choosing React Native means that all you need is JavaScript. And on the other hand, NativeScript gives you more freedom by supporting the declarative coding style. It means that if you are not happy with a specific feature in one framework, you can use any other JavaScript framework, including Angular, TypeScript, and Vue.js.

Native APIs integration

NativeScript

Developers using NativeScript have direct access to native APIs both for Android and iOS without writing code in Kotlin/Java (for Android) or Objective-C/Swift (for iOS) languages.

React Native

While React Native connects with native APIs like NativeScript, it needs the help of special bridges. And that’s the reason why you may need some native language knowledge. Integrating such bridges – even though there are some readymade bridges provided by developers – still requires some amount of effort.

Performance

NativeScript offers slow rendering and In the world where every second count, it’s something hard to accept. And that’s where React Native enters the stage. Rendering dynamic elements, which looks like rendering in apps using native SDKs, is possible thanks to the Virtual DOM. DOM makes React Native performant and helps overhaul NativeScript in this case.

Third-party plugins

NativeScript offers Marketplace where you can find any plugins you may need. Because of that, third-party solutions aren’t required. On the other side, React Native relies on third-party plugins, but there are many resources available, and generally, it isn’t a problem to find what you need.

Top comments (0)