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; 7 years ago (2015-03-26)[1]
Stable release
0.68 Edit this on Wikidata / 30 March 2022; 2 months ago (30 March 2022)
Repositoryhttps://github.com/facebook/react-native
Written inJavaScript, Java, C++, Objective-C, Python
PlatformAndroid, Android TV, iOS, macOS, tvOS, Web, Windows, UWP, and VR
TypeApplication framework
LicenseMIT License
Websitereactnative.dev

React Native is an open-source UI software framework created by Meta Platforms, Inc.[2] It is used to develop applications for Android,[3][4] Android TV,[5] iOS,[4] macOS,[6] tvOS,[7] Web,[8] Windows[6] and UWP[9] by enabling developers to use the React framework along with native platform capabilities.[10] It is also being used to develop virtual reality applications at Oculus.[11]

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".[12][13] Using HTML5 for Facebook's mobile version resulted in an unstable application that retrieved data slowly.[14] He promised 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, which became the basis for the React web framework. They decided to organize an internal Hackathon to perfect this prototype in order to be able to build native apps with this technology.[15]

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

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 serialized data over an asynchronous and batched bridge.[18][19]

React components wrap existing native code and interact with native APIs via React's declarative UI paradigm and JavaScript.

While React Native styling has a similar syntax to CSS, it does not use HTML or CSS.[20] Instead, messages from the JavaScript thread are used to manipulate native views. With React Native developers have to write native code in the languages of the aimed platform such as Java or Kotlin for Android, Objective-C or Swift for iOS, and C++/WinRT or C# for Windows 10.

Microsoft builds and maintains React Native for Windows and React Native for macOS.

Hello World example[edit]

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

import { AppRegistry, Text } from 'react-native';
import * as React from 'react';

const HelloWorldApp = () => {
  return <Text>Hello world!</Text>;
}

export default HelloWorldApp;

AppRegistry.registerComponent('HelloWorld', () => HelloWorldApp);

See also[edit]

References[edit]

  1. ^ "React Native: Bringing modern web techniques to mobile". 26 March 2015.
  2. ^ "Chapter 1. What Is React Native?". oreilly.com. O’Reilly Media, Inc. Retrieved 30 July 2020.
  3. ^ "Android Release for React Native". 14 September 2015.
  4. ^ a b Shankland, Stephen (March 29, 2018). "Mozilla's radical open-source move helped rewrite rules of tech". CNET. Retrieved May 11, 2022.
  5. ^ "Building For TV Devices · React Native". reactnative.dev. Retrieved 2020-10-02.
  6. ^ a b "React Native for Windows + macOS · Build native Windows & macOS apps with Javascript and React". microsoft.github.io. Retrieved 2020-10-02.
  7. ^ "React Native for Apple TV". React Native for Apple TV. Retrieved 2020-10-02.
  8. ^ "React Native for Web". Retrieved 2019-11-06.
  9. ^ Windows Apps Team (April 13, 2016). "React Native on the Universal Windows Platform". blogs.windows.com. Retrieved 2016-11-06.
  10. ^ "Out-of-Tree Platforms". reactnative.dev. Facebook, Inc. Retrieved 30 July 2020.
  11. ^ "React Native in H2 2021 · React Native". reactnative.dev. Retrieved 2021-08-20.
  12. ^ "Zuckerberg's Biggest Mistake? 'Betting on HTML5'". Mashable. Retrieved 7 April 2018.
  13. ^ Zuckerberg, Mark (2012-09-12). "Fireside Chat With Facebook Founder and CEO Mark Zuckerberg". TechCrunch (interview). Retrieved 2021-08-16.{{cite web}}: CS1 maint: url-status (link)
  14. ^ Warren, Christina. "Zuckerberg's Biggest Mistake? 'Betting on HTML5'". Mashable. Retrieved 2020-10-29.
  15. ^ "A short Story about React Native". Retrieved 16 January 2018.
  16. ^ Christopher, Chedeau. "A Deep Dive into React Native". YouTube. Retrieved 16 January 2018.
  17. ^ "React Native: Bringing modern web techniques to mobile". 26 March 2015.
  18. ^ "Bridging in React Native". 14 October 2015. Retrieved 16 January 2018.
  19. ^ "How we build React Native app: 7 things which save your development time. Part 2". Retrieved 2019-11-06.
  20. ^ "React Native Style". Retrieved 24 February 2021.