What is React Native?


React Native is an open source JavaScript Mobile framework from Facebook specially designed to build native mobile apps for iOS and Android. React Native is based on ReactJS JavaScript library that helps to build the user interface for mobile platforms.

React Native can be directly used inside an existing IOS or android app or you can build a native app right from scratch. At present React Native is used with some popular apps like Facebook mobile app, Instagram, Pinterest, Skype, etc.

Some important features of React Native that makes it a very popular mobile development app today are −

Cross Platform Support − To develop mobile apps you don’t need a team expert in IOS and Android programming instead JavaScript developers who are enthusiastic to build apps can use React Native to build native apps without having to learn Kotlin or Java for Android and Swift or Objective-C for IOS apps. You can write one common code and React Native will take care of displaying it in IOS and Android.

React Native Components − React Native offers native components like View, Text, and Image that are changed to the IOS or Android native UI.

Here is a simple example using react native that displays the text Hello World:

Example

import React from 'react';
import { Text, View} from 'react-native';

const App = () => {
   return (
      <View style={{flex :1, justifyContent: 'center', margin: 15}}>
      <Text style={{color:'red', fontSize:30}}>Hello World</Text>
      </View>
   );
}

export default App;

Output

JSX − As ReactJS is for the web world, React Native is meant for the mobile app world. React Native makes use of JSX i.e., an XML for writing code that replaces HTML and CSS. The advantage of JSX is as follows −

  • It is faster because it performs optimization while compiling code to JavaScript.

  • It is also type-safe and most of the errors can be caught during compilation.

  • It makes it easier and faster to write templates, if you are familiar with HTML.

React Native App Build and Testing − It is very easy to build your app in react native and also to test the changes without any compilation headache. The changes are available soon for display the moment you save your code.

About React Native Release − The first version of React Native was released by Facebook in the year 2015 and from there onwards they are updating and maintaining it. It has gained a lot of popularity post the release as it is one of the top most frameworks used for mobile apps development. As per React Native official website, in 2018 React Native has been the 2nd highest number of contributors for any repository in GitHub. Today, React Native is supported by contributions from individuals and companies around the world including Callstack, Expo, Infinite Red, Microsoft and Software Mansion. The Facebook community has been very active and updates the projects regularly with new updates across platforms.

Updated on: 01-Jul-2021

862 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements