DEV Community

Ronak Patel
Ronak Patel

Posted on • Updated on

NativeScript V/s React Native: What To Choose For Cross-Platform App Development

NativeScript Vs React Native

When it comes to building hybrid apps for mobiles, you can find several frameworks available in the market. With such frameworks, you can write the codes once and the build application will run on both iOS and Android. When it comes to such hybrid frameworks, the greatest issue you will face is that you cannot access native components and they make use of web view for rendering. It is in such a situation where NativeScript and React Native prove to be a better solution. You can use them to write code once and then run it across both Android and iOS platforms all the while ensuring access to native components.
To begin with, let’s see what these hybrid app development platforms are…

What is NativeScript?

NativeScript is a JavaScript framework which is used to develop native mobile applications for Android and iOS platforms just using a single codebase. By using this framework, it is possible to get access to user interface, native APIs and rendering engines of Android and iOS. So all you have to do is to build a single project and it will run on both platforms while offering complete native user experience.

What is React Native?

React Native is a JavaScript framework which is used to build native applications for Android and iOS platforms. It is based on the JavaScript library of React which was developed by Facebook to build interfaces. This JavaScript library focuses on mobile platforms instead of user interfaces. This means developers can make use of this JavaScript library and easily build mobile applications with native features and look. Additionally, you can easily share the same code between iOS and Android platforms when developing applications.

Comparison with Respect to Features

Learning curve:

With NativeScript you will be able to create apps based on JavaScript, AngularJS and TypeScript. It also supports the declarative coding style. This means that if you are not happy about a feature getting developed in a language, you can switch to another one easily. While in case of React Native, you will have just to use JavaScript for coding.

Whatever option you choose for your project, you need to be sure you make a choice based on your development experience.

Application size:

If you are planning to develop a cross-platform mobile app with complex business logic then choosing React Native can be best for your app project. This is because if you choose NativeScript for the task, then the end solution will be quite large in size. With high-speed internet connection not available everywhere building such kind of app will be not wise. When it comes to reaching a wider target base, app size always plays a key role.

Plugin & third-party solutions support:

Based on any specific development needs, NativeScript offers you a complete web resource which comes with plugins for any solution. This makes the need to have any third-party solutions completely unnecessary. When it comes to React Native you will not find such a dedicated website offering plugins but, there are many communities where you can find such plugins easy to be used.

Performance:

When it comes to performance, React Native does not give any chance to NativeScript. By making use of Virtual DOM, you can easily render dynamic elements just like that which you can normally find in apps written using native SDKs. In a time where the need for better responsiveness is important, NativeScript rendering is quite slow which is not that acceptable.

Interaction with native APIs:

When working with NativeScript you can easily get access to native Android and iOS APIs. This means you don’t need any knowledge of native development languages to work on. In case of React Native, you don’t get to enjoy such capabilities. In order to connect with native APIs, React Native makes use of special bridges. So for the same reason, it becomes important to know the corresponding native languages. It has to be noticed that the developers in the React Native community already provides readymade bridges to the APIs conveniently.

Online community:

Even though React Native and NativeScript came into existence around the same time, React Native enjoys a larger community of React Native Developers compared to NativeScript. One of the main reasons for it can be that React Native was developed by the developers at Facebook who are well known across the world. This has made React Native quite popular and it enjoys an extensive fan base compared to any other cross-platform frameworks.

Comparison with respect to the pros and cons of React Native and NativeScript

Difference in the programming language

NativeScript makes use of Angular and TypeScript for programming. Here the native APIs is first wrapped in TypeScript friendly equal and then to Angular friendly equal as the community is divided between the two technologies. On the other side, JSX is used in React Native Development. When React works on to create a single file, NativeScript keeps every component divided. You can run both these technologies on old JS as well as in the preferred language of the platforms.

Difference in performance

React Native offers amazing native experience to the applications. It also offers native contributing to make things faster. NativeScript also offers native contributing by making use of Angular, but when compared with React Native, it is slow.

Difference based on third-party libraries

React Native is a technique which was developed by the developers of Facebook. The developers have started to use React Native recently once it attained a maturity level. Today several third-party applications have come up to offer APIs for React Native. NativeScript enjoys a large number of third party plugins which can be used to improve the performance of the applications. There is no match of React Native with it in terms of its count, but these plugins are not completely verified.

Differences in aim

React Native focuses on “Learn once, write anywhere”. It aims at developing high performing applications with an appealing user interface. With React you can create amazing UI for every platform. NativeScript focuses on “Write once, use anywhere”. This means the codes will be written once and then you can have running across the different platforms. At this point, NativeScript wins over React Native.

Application of React Native and NativeScript

Apps Made of React Native Apps Made of Native Script
Skype Strudel (dating app)
Instagram BitPoits Wallet
Tesla Daily Nanny
Shine Regelneef (monitors energy consumption)
Uber Eats Dwitch (food delivery service)

React Native is suitable to use when:

  • You want to develop native apps that perform well for iOS and Android
  • You want to use native interfaces for native performances
  • Instead of using any third party plugins, you can access hardware functionalities using specific platform

NativeScript is suitable to use when:

  • JavaScript or Typescript is available everywhere
  • When you are planning for cross-platform approach for app development needs
  • When you want to use Angular to get access for web components
  • When you want native API access with complete native experience

Google Trends Comparison for both technologies

React Native vs Native Script - Google Trends

This shows the interest shown in the technologies over time. The graph of React Native shows that there have been fluctuations in the interest of React Native over time while it remains almost the same in case of NativeScript.

Some Statistics to Mentioned

  • Weekly downloads of React Native are 285,096; Github stars are 75,963
  • Weekly downloads of NativeScript are 33,650; Github stars are 16,619

This clearly points to the fact that React Native is quite powerful in terms of enjoying community support and it outruns NativeScript easily.

Looking into AirBnB comparing React Native Vs NativeScript

Would AirBnB have done better with NativeScript instead of React Native?

A few months back AirBnB published a 5-part series regarding their decision to leave React Native.

The announcement of AirBnB has created an interest in the minds of the IT experts and raised a question on what would have happened if they preferred to go for NativeScript! The feedback that came from AirBnB in terms of React Native was completely technical and it covered the areas where NativeScript took a different turn in terms of app development.
So here we will take a look at the complaints that AirBnB had with React Native and look for solutions by choosing NativeScript.

In there, AirBnB was talking a lot about how their decision to go for React for the web contributed towards choosing the same technology for native apps. Therein they also talk about how after the initial development using React Native they started to look into the code sharing aspect between native apps and web. Through their investigation, they found that as Redux was used for the web, it was possible to share large amounts of code without any kind of alteration between the native platforms and web.

For an app development company, framework consolidation can be very important. At the beginning with the initial version, even NativeScript offered no support for framework while experiencing some usage, but after it started with Angular support, there was a tremendous increase in the usage of NativeScript.

It is good to know that when you have an idea about concepts like data binding, navigation and other key features along with the ability to share code between native and web apps directly, the developers will turn out to be more productive.

However, NativeScript does not offer any support for React and for companies like AirBnB which has invested in the technology heavily, does not find it good. There is a lot of work when it comes to supporting frameworks especially when you have to think about templates, tooling, documentation, etc.

Hot reload

One of the main benefits of making use of JavaScript for developing native apps is that it speeds up the development cycle. Here the source code is written in JavaScript, and so there is no need to compile the code every time a change is made and this way it is possible to boost productivity enormously.

Based on the productivity gains that come from JavaScript, React Native and NativeScript can take advantage of the situation.

Even though NativeScript and React Native can gain from the advantages of JavaScript, React Native can go a step ahead by using the feature of hot reloading. This is a feature that comes with React Native where without losing the state of the application you can reload the app whenever a change is made. Now this feature is incredibly best and you will be able to see the JavaScript changes in a very less amount of time.

Similarly, NativeScript comes with LiveSync which is speedy and you can make use of it on as many devices as you want during development. Whenever you are making changes to the NativeScript, you will be able to see the changes within a second which would typically take up 15-20 seconds in case of any native apps.

It is true that NativeScript does not come with the hot reloading feature but this is something that the NativeScript team is working on and it will not be long enough when you will find the updated version which reloads in few milliseconds.

Integrating into native apps

If your business has an existing app which is huge and based on Android and iOS technology then rewriting it to a new technology will not be an easy thing. Now NativeScript does offer the feature of running within existing apps, and its support service is still in its experimental phase. This means they are not officially ready for the job.

Meanwhile, when we talk about React Native, their team has much invested in this area and have many apps running in that scenario for production. Again, for Facebook, their future re-architecture program is all about establishing better integration with native apps.

Again, there are issues with the architecture of React Native. When you are talking about integrating NativeScript or React Native with an existing app, it can cause complexities. Now, these complexities can cause issues as the platforms of iOS and Android, and JavaScript frameworks like React Native and NativeScript are undergoing continuous evolution.

This means it can be said that a share of issues faced by AirBnB came from their decision to integrate React Native to their existing complex app rather than planning to come up with a new one using NativeScript or React Native.

Final thoughts on the same…

So would have been the AirBnB project gained with the NativeScript?

Now, this is something that no one knows. Still, it can be said that NativeScript would have helped AirBnB to tackle several issues that it faced with React Native like dealing with types, working with native APIs and building fast lists. Again, it has to be added that NativeScript does not offer support for React and when it comes to integrating with complex existing apps, it would not have offered the same level of service as React.

So just like making a decision in terms of any other big technology, it would always be good that you come up with proof-of-concept apps with whatever options you have with you before you actually dive into a full level project.

Wrapping it up

So in terms of React Native V/s NativeScript – where do we stand? Based on this post we can see that both the frameworks can be used by businesses to develop commercial mobile app solutions with extensive capabilities. So if you are thinking about which one is stronger and reasonable to choose for your project, then the answer entirely relies on the particular demands and all the aspects of the said project. When we look through the performance perspective, React Native leads and yes, it is quite popular and preferred choice of businesses around the world. On the other hand, NativeScript offers developers easy access to third-party libraries and native APIs which is very important criteria to look for when choosing a framework for app development with flexibility.

Top comments (4)

Collapse
 
wishinghand profile image
Jason Land

I was hoping for some hard numbers in the comparison. You say React Native wins out with speed and file size, but by how much? Enough to be worth switching? You say the speed is slow because there's no V-DOM in Nativecsript, but fail to mention that there's a Vue implementation which is on par or better that React file size and performance.

You also pretend large companies aren't using Nativescript by comparing huge Silicon Valley companies using React Native to a bunch of apps no one has heard of using Nativescript. Except that Samsung, Target, Qualcomm, Volvo, and other large non-SV companies have deployed it.

Collapse
 
sujitsingh profile image
Sujit Kumar Singh

This article is a good try but not well researched(just based on other online articles), probably biased and far away from reality.
Both NativeScript and ReactNative are equally comparable to both feature and performance wise. But, the prior one supports Angular(2+) and VueJS, while the later only ReactJS.
V-DOM is fast? Arguably with definite memory and process overheads. Ever heard of Incremental DOM?

Collapse
 
wishinghand profile image
Jason Land

so their decisions are somewhat more indicative of the frameworks' advantages than those of the other big firms you named

I'm not so sure. In Facebook's case, I think it's because they invented React. Likely the same with Google and Angular.

Collapse
 
jpolvora profile image
Jone Polvora

it looks like a little biased for react.