Let's imagine you need to build a new mobile application. In Order to target 99% of smartphone users, we'll have to build two apps:
One for Android and one for iOS, that's mean you'll have to manage two of everything: language, codebases, developer teams, feature sets, release schedules etc.
Hiring two developer teams is expensive, and hiring a single team that has in-depth knowledge of both Android and iOS is almost impossible.
React Native is a framework for building cross-platform apps developed by Facebook for solving this problem of managing two of everything. Their goal was to build a platform that enables you to have:
The platform offers a way to build mobile applications using React and JavaScript (Typescript 😉).
Instead of the span
primitive, which we have on the web, React Native offers the Text
primitive. If we are building an iOS app, React Native will make sure that the Text
results with a native iOS UIView
containing the text. If we are building an Android application, it will result with a native TextView
.
The difference between React Native and other cross-platform development solutions (for example, Cordova and PhoneGap) is that React Native doesn’t render WebViews in its code. It runs on actual, native views and components. This is one of the reasons for React Native’s spectacular success.
React Native allows the development of apps consisting of JS code and native by making the bridge between an app and a target platform. When JavaScript has been running along with some native code, the React Native’s bridge system leverages the React library and transfers components’ hierarchy to the mobile device view.
The current React Native architecture is based on 3 major pillas:
Such architecture has certain challenges. On the one hand, default components may not cover both platforms or may look very different. On the other hand, bridging architecture allows using all existing native views from platforms SDK and JS libraries.
Being single-threaded, React Native apps are easy to understand since everything that works with JavaScript on the web, will work the same way on React Native. But it’s important to consider JS specifics while developing an app architecture in order to avoid performance issues. If the architecture of the future app involves many events and a lot of data, React Native app development may not be the best option since the bridge structure may cause delays.
It been 2 years now when React Native core team introduce a big movement to Re-Architecture React Native. The new React Native architecture is expected to bring a series of significant improvements that will streamline the development process and make it more convenient for all parties involved.