React Native

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
React Native
React-icon.svg
Developer(s)Facebook and community
Initial releaseMarch 26, 2015; 4 years ago (2015-03-26)[1]
Stable release
0.61.5 / November 23, 2019; 7 days ago (2019-11-23)[2]
Repositoryhttps://github.com/facebook/react-native
Written inJavaScript, Java, C++, Objective-C, Objective-C++, Python
LicenseMIT License
Websitefacebook.github.io/react-native/

React Native is an open-source mobile application framework created by Facebook.[3] It is used to develop applications for Android[4], iOS, Web[5] and UWP[6] by enabling developers to use React along with native platform capabilities.

Furthermore, an incomplete port for Qt also exists.[7]

History[edit]

In 2012 Mark Zuckerberg commented, "The biggest mistake we made as a company was betting too much on HTML as opposed to native".[8] He promised that Facebook would soon deliver a better mobile experience.

Inside Facebook, Jordan Walke found a way to generate UI elements for iOS from a background JavaScript thread.[9] They decided to organise an internal Hackathon to perfect this prototype in order to be able to build native apps with this technology.[10]

After months of development, Facebook released the first version for the React JavaScript Configuration in 2015. During a technical talk,[11] Christopher Chedeau explained that Facebook was already using React Native in production for their Group App and their Ads Manager App.[12]

Implementation[edit]

The working principles of React Native are virtually identical to React except that React Native does not manipulate the DOM via the Virtual DOM. It runs in a background process (which interprets the JavaScript written by the developers) directly on the end-device and communicates with the native platform via a serialisation, asynchronous and batched Bridge.[13][14][15]

React components wrap existing native code and interact with native APIs via React’s declarative UI paradigm and JavaScript. This enables native app development for whole new teams of developers, and can let existing native teams work much faster.[citation needed]

React Native does not use HTML. Instead, messages from the JavaScript thread are used to manipulate native views.

Hello World Example[edit]

A Hello, World program in React Native looks like this:

 1 import React, { Component } from 'react';
 2 import { AppRegistry, Text } from 'react-native';
 3 
 4 export default class HelloWorldApp extends Component {
 5   render() {
 6     return (
 7       <Text>Hello world!</Text>
 8     );
 9   }
10 }
11 
12 // Skip this line if using Create React Native App
13 AppRegistry.registerComponent('HelloWorld', () => HelloWorldApp);
14 
15 // The ReactJS code can also be imported from another component with the following code:
16 
17 import HelloWorldApp from './HelloWorldApp';

References[edit]

[16]

  1. ^ "React Native: Bringing modern web techniques to mobile".
  2. ^ "Releases – Facebook/React". GitHub.
  3. ^ "React Native · A framework for building native apps using React". Retrieved 2019-11-06.
  4. ^ "Android Release for React Native".
  5. ^ "React Native for Web". Retrieved 2019-11-06.
  6. ^ Windows Apps Team (April 13, 2016). "React Native on the Universal Windows Platform". blogs.windows.com. Retrieved 2016-11-06.
  7. ^ https://github.com/status-im/react-native-desktop
  8. ^ "Zuckerberg's Biggest Mistake? 'Betting on HTML5'". Mashable. Retrieved 7 April 2018.
  9. ^ "React (JavaScript library)".
  10. ^ "A short Story about React Native". Retrieved 16 January 2018.
  11. ^ Christopher, Chedeau. "A Deep Dive into React Native". YouTube. Retrieved 16 January 2018.
  12. ^ "React Native: Bringing modern web techniques to mobile".
  13. ^ "Bridging in React Native". 14 October 2015. Retrieved 16 January 2018.
  14. ^ "React Native vs Flutter: Which Cross-Platform Framework is Better?". Retrieved 2019-11-06.
  15. ^ "How we build React Native app: 7 things which save your development time. Part 2". Retrieved 2019-11-06.
  16. ^ Benefits of React Native and comparison with Native development