In the final instalment of our comparison of RN with other mobile technologies, we will compare React Native to its closest alternative: another JavaScript-based framework known as NativeScript.
What is NativeScript
NativeScript is an open-source framework initially developed by Progress and then handed-off to nStudio. With over 20k stars on GitHub, NativeScript is designed to build cross-platform applications using JavaScript or any other programming language that transpile to JavaScript, such as TypeScript, that once written would operate on mobile, web and TV platforms.
What is React Native
React Native can be easily dubbed the king of cross-platform development as currently it’s the single most popular framework (with nearly 100k stars on GitHub), and is designed to enable creation of native-like experiences for both iOS and Android. Developed internally at Facebook and later released on an open-source licence, it quickly gained popularity and a hardcore fanbase.
React Native vs NativeScript
This comparison is probably the hardest one I’ve done so far as both technologies have lots of similarities due to their JavaScript-based nature and the decision for picking one of the two will most likely come down to factors (outside the technical side of things.cons: “other than technical”).
NativeScript Pros
Better suited for projects with Angular, Vue.js or Svelte tech stack
NativeScript launched with extensive support for Angular and Vue.js so if your core web frontend is written in these languages then it might be easier to write your apps using NS as you won’t have to expand your tech stack and either re-purpose your developers, or hire new ones. NativeScript also added support for Svelte, which Svelte labelled as Svelte Native.
NativeScript Marketplace
Unlike React Native with its extensive third-party market of available plugins and libraries, NativeScript maintains its own official marketplace where it manages and updates new plugins on a regular basis. As a result, the risk of finding a third-party plugin that has either already been abandoned or is likely to be soon, becomes much lower.
Easier access to native APIs
One of the biggest differences between NativeScript and React Native is the way they handle native APIs. While RN relies on bridges that are either provided by the community (besides the basic ones provided by Facebook) or custom-built, NativeScript’s team decided to inject all the Android and iOS APIs into their JavaScript Virtual Machine (JVM), making it easier to access native APIs without requiring additional native knowledge.
NativeScript Cons
Fewer developers available on the market
Because NativeScript is less popular than React Native, finding NativeScript developers might be a much more difficult task. But should the unforeseen happen, your team may require the rapid addition or exchange of developers and you might find yourself in a tough situation.
No support for HTML or DOM
Lack of support for the above technologies takes away from your developers the ability to use some JavaScript libraries, such as jQuery for instance.
Single-thread model
To provide quicker access to native APIs, NativeScript script utilized a single-thread model which means JavaScript is executed on the main thread, (also known as UI thread), which can cause UI lags and slowness if overloaded.
React Native Pros
Better suited for projects with React tech stack
Even though NativeScript as of late also started to support React, in our opinion it’s better to choose React Native for your cross-platform developers if React is the core technology.
RN is built and maintained by Facebook, just like React, and was built for React and React only in mind.
Better performance
React Native separates the UI and JS threads and so is not slowed by the same overload situations that can occur with NativeScript. React Native also uses Virtual DOM for faster UI rendering and is designed to provide a native-like experience thanks to platform-specific UIs.
Over-the-air (OTA) updates
Over-the-air updates allow developers to push updates to their React Native cross-platform applications in the background without the need for users to download directly from the app store. This provides a seamless experience for the end-user as well as better control over the app for the developers.
Extensive community
Because of React Native’s popularity, its communities serve not only as a great source of third-party plugins and libraries for a wide range of uses but also as a comprehensive knowledge bank that can provide help for newcomers as well as those with complex development challenges.
More developers available for hire
In contrast to NativeScript, React Native’s widespread use means that there is a larger pool of developers on the market, which makes it faster to hire new people and reduces the cost of recruitment and saves time.
React Native Cons
Might require some native development
Due to the bridge-based access to native APIs, React Native applications might require custom bridges to be written. To do that, you may occasionally need to involve someone with a decent understanding of the selected platform’s native language. And even though it doesn’t happen very often it is only fair to mention the possibility.
Conclusion
To sum up then, NativeScript is a very interesting framework that might work just as well as React Native for your cross-platform developments, but there are areas where RN’s maturity and high adoption cannot be beaten.
Of course the choice is yours and hopefully the insights contained in this article will be of some use when making a decision.
Should you need any help evaluating your specific needs, then feel free to drop me a line at: ross@rst.software. That’s it from me today — I’ll see you next time!