React Native Basics

2019-01-22 05:19:42    Created by Jayeesha

React Native Basics

React Native is a JavaScript framework, designed for building genuinely native apps for platforms like iOS and Android. It’s based on a JavaScript library created by Facebook called React, and thus brings its power to native mobile app development.

It corresponds with today’s mobile app development market needs, as with two operating systems dominating the landscape, enterprises creating mobile apps often face a decision: build apps that give a better user experience or apps that are faster to develop and run on more platforms and devices?

The concept of creating apps using only one paradigm for all platforms sounds a bit unbelievable. However, React Native, despite its immaturity, allows accelerating the process of building apps across different platforms, thanks to the likelihood of reusing most of the code between them.

What is React Native?

React Native is a native version of the popular web library of the same name and its main purpose is to bring the power of React to native mobile apps development.

React Native components are pure, side-effect-free functions that return what the views look like at any point in time. For this reason, it is easier to write state-dependent views, as you don’t have to care about updating the view when the state changes since the framework do this for you. The UI is rendered using actual native views, so the final user experience is not as bad as other solutions that simply render a web component inside a WebView.

What reason are the largest companies using React Native for?

#1 Facebook & React Native

React Native commenced as Facebook’s hackathon project developed in response to the company’s needs. Facebook wanted to bring all the advantages of web development – such as quick iterations and having a single team develop the whole product – to mobile. That is how React Native was brought to life and leveraged in mobile app development for both iOS and Android apps.
 

Why did they choose React Native?

Originally, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can now provide mobile UIs for both platforms. Facebook used React Native to develop its own Ads Manager app, creating both an iOS and an Android version. Both versions were created by the same team of developers.

Facebook also made React Native open-source, with the idea that compatibility with other platforms like Windows or tv OS could be operated on by the development community, so stay tuned.
 

Results of building a React mobile app

Performance improvements: Events Dashboard startup is now twice as fast. Most of the advances made were done at the framework level, which determines your React Native app will automatically benefit when transferring to the latest version of React Native app.

#2 Instagram & React Native

Instagram accepted the challenge to integrate React Native into their existing native app beginning from the simplest view you can imagine: the Push Notification view which was basically implemented as the WebView. It did not require building navigation infrastructure, as UI was quite simple.

Why did they choose React Native?

The dev team at Instagram faced a few problems on the way, but they substantially improved developer velocity. 85% to 99% of code was shared between Android and iOS apps, depending on products, thus the team was able to deliver the app much faster than they would have with a native solution.

Instagram & React Native
 

Why did they choose?

React Native allows you link the plugin with a native module, so you can connect the map up with the device’s functions like rotate, zoom, and the compass, while utilizing less memory and loading faster. If your app supports previous operating systems (and older devices), this can help you keep the app running smoothly.