Why Do We Love React Native for Building Native iOS and Android
“The ease and agility of Facebook’s React framework binded with promise of delivering truly native feel and efficiency on both iOS and Android makes us love React Native.”
A Glance at the History of Hybrid Mobile Applications:
There has always been a notion of Hybrid mobile applications in the software industry, it came with technologies like Phonegap, ionic, Apache Cordova and others. Even Apple before releasing their own iOS SDK encouraged developers to write and deliver web apps for iPhones. But at the core of development, every technology uses webviews (a native browser component to render HTML). So, essentially, they are all websites embedded in a mobile app through what we call a WebView. One of the biggest problem when building mobile app with these technologies is that they inherit all issues that web has, like the bugs of styles working differently on different browsers which indirectly also breaks the standards as imposed by respective OS platforms.
The reasons to prefer React Native
1) It’s all Native !
One of the biggest reasons for React native to become so popular amongst the developer community and also to become our favourite for cross platform app development is its promise for being truly Native in every sense. It is built with a concept of solid JS-OEM bridging architecture for functionality as well as UI because of which it conforms to every standard as imposed by the different OEMs thus providing native feel, along with faster performance as compared to traditional hybrid technologies which makes React Native revolutionary in the hybrid app development space.
2) Reactive in nature.
“UI is the function of data; If data changes, UI should change.”
React Native, coming from the family of Facebook’s ever successful React framework makes it ready for being reactive in nature as each screen (Activity – android and UIViewController – iOS) in React Native extends from React’s Component so automatically inherits all the React’s lifecycle callbacks and with the added usage of predictive state container like Redux, it really becomes very easy to work with shared state of data throughout the application lifecycle, thereby proving React Native to be one of the best architectural approach for Reactive programming for mobile applications which is a buzzword among the mobile developers these days. In native technology stack, the reactiveness comes at the cost of a whole bunch of extra code like in android – RxAndroid is one of the popular libraries to help write reactive applications. Likewise in iOS there are RxCocoa and RxSwift which enable the developers to write reactive applications. So with the future point of view, a language coming pre-equipped with reactive programming architecture is self explanatory to be opted for applications demanding reactive paradigm.
Redux in action with React Native.
3) Shared codebase for different platforms.
For example: <View> in React Native directly maps to native android.view in android and UIView in iOS.
4) You are the pilot : Fly out mission critical application parts from RN to pure native code to keep the stuff in control.
5) It is fast !
React Native is just sufficiently great to keep your app’s UI running at a stable rate of 60 frames per second. Behind the scenes, the JS code runs on its own thread, separate from the main UI thread of the app. So even when your app is working on hard parts of logics like computation, your UI will be smoothly running at rate of 60fps as long as UI is not blocked by JS thread.
6) Smaller release cycles of RN and humongously large community.
Facebook releases major updates in the technology every 2 weeks which itself speaks about its fast development curve and the maturity it is attaining. Also, being a revolutionary mobile tech, it has a huge fan base of developers who keep on contributing to the open source either directly to React Native code or as third party libraries published as npm modules thus providing rapid development opportunities. To name a few, which are must needs of any mobile applications are:
- react-navigation : Gives navigation component for navigating between application screen and maintaining navigation hierarchy.
- react-native-vector-icons : Helps render vector assets using declarative JSX statements, supports different icon providers – material icon, font awesome, entypo, Feather, etc.
- react-native-fetch-blob: Gives native filesystem and data transfer support.
- react-native-fcm: A firebase cloud messaging wrapper for React native.
7) React Native in action
React native is becoming a preferred choice of many companies including many from Fortune 500 too. Just to quote a few names, here’s a list that includes links and specifies how they are using React Native in their products.
and many others too. If you have come this far, I would like to thank you. It’s now time for some interesting analysis conclusions:
Though there are huge number of pros of using React Native, if i am being honest there are a few things which are really annoying as well :
- The official documentation is not as great as the android’s and ios’s documentations.
- You need to have certain expertize with native code as well as with at least one platform, if you are trying to develop complex application.
But these are not just big enough things to stop this bleeding edge technology from evolving.
When making a comparative analysis between the three technology stacks in terms of developer productivity, faster development iterations, performance and cost, React Native really stands out. Because it really enables quicker prototyping with JSX, ability to write native module to make performance boosts in the application and the easy learning curve that really encourages people to adapt it faster than ever before especially web developers familiar with React can adapt to mobile stack in no time justifying the Facebook’s “Learn once, write everywhere” vision for React framework.