Zum Inhalt springen

React Native

aus Wikipedia, der freien Enzyklopädie
Dies ist eine alte Version dieser Seite, zuletzt bearbeitet am 5. Juni 2023 um 03:35 Uhr durch en>Cngzz1 (Fixed in-line citation issues.). Sie kann sich erheblich von der aktuellen Version unterscheiden.

Vorlage:Short description Vorlage:Unreliable sources Vorlage:Infobox software

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

History

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

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.

React Native is also available for both Windows and macOS, which is currently maintained by Microsoft.

Hello World example

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

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

const HelloWorldApp = () => {
  const [count, setCount] = React.useState(0);
  
  const incrementCount = () => {
	setCount(count + 1);
  };

  return (
    <div>
        <Text>Hello world!</Text>
        <h5>{count}</h5>
		<button type={'button'} onClick={incrementCount}>
			Increase Count
		</button>
    </div>
  );
}

export default HelloWorldApp;

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

See also

Citations

Vorlage:Reflist

References

Vorlage:Facebook navbox

  1. Chapter 1. What Is React Native? In: oreilly.com. O’Reilly Media, Inc., abgerufen am 30. Juli 2020.
  2. Android Release for React Native. 14. September 2015;.
  3. a b Stephen Shankland: Mozilla's radical open-source move helped rewrite rules of tech. In: CNET. 29. März 2018, abgerufen am 11. Mai 2022.
  4. Building For TV Devices · React Native. In: reactnative.dev. Abgerufen am 2. Oktober 2020 (englisch).
  5. a b React Native for Windows + macOS · Build native Windows & macOS apps with Javascript and React. In: microsoft.github.io. Abgerufen am 2. Oktober 2020.
  6. React Native for Apple TV. In: React Native for Apple TV. Abgerufen am 2. Oktober 2020 (amerikanisches Englisch).
  7. React Native for Web. In: GitHub. Abgerufen am 6. November 2019.
  8. Windows Apps Team: React Native on the Universal Windows Platform. In: blogs.windows.com. 13. April 2016, abgerufen am 6. November 2016.
  9. Out-of-Tree Platforms. In: reactnative.dev. Facebook, Inc., abgerufen am 30. Juli 2020.
  10. React Native Showcase. In: react.native.dev. Abgerufen am 4. April 2023 (englisch).
  11. React Native in H2 2021 · React Native. In: reactnative.dev. Abgerufen am 20. August 2021 (englisch).
  12. Zuckerberg's Biggest Mistake? 'Betting on HTML5'. Mashable, abgerufen am 7. April 2018.
  13. Mark Zuckerberg: Fireside Chat With Facebook Founder and CEO Mark Zuckerberg. In: TechCrunch. 12. September 2012, abgerufen am 16. August 2021.
  14. Christina Warren: Zuckerberg's Biggest Mistake? 'Betting on HTML5'. In: Mashable. Abgerufen am 29. Oktober 2020 (englisch).
  15. A short Story about React Native. Abgerufen am 16. Januar 2018.
  16. Chedeau Christopher: A Deep Dive into React Native. In: YouTube. Abgerufen am 16. Januar 2018.
  17. React Native: Bringing modern web techniques to mobile. 26. März 2015;.
  18. Bridging in React Native. 14. Oktober 2015, abgerufen am 16. Januar 2018.
  19. How we build React Native app: 7 things which save your development time. Part 2. Abgerufen am 6. November 2019.
  20. React Native Style. Abgerufen am 24. Februar 2021.