React Native

0.85.1 · active · verified Sun Apr 19

React Native is an open-source UI software framework for developing cross-platform native mobile applications for iOS and Android using JavaScript and React. It enables developers to write code once and deploy it to multiple platforms, leveraging native UI components for optimal performance and user experience. The current stable version is 0.85.1, with new minor versions typically released every two months and frequent patch releases, indicating an active and rapidly evolving development cycle. Key differentiators include its declarative component-based UI paradigm inherited from React, direct access to native device features through JavaScript Interface (JSI), and a vast ecosystem of third-party libraries. Unlike hybrid webview solutions, React Native renders actual native UI elements, which contributes to a more authentic native look and feel, and starting from 0.82, it exclusively uses the New Architecture, removing the legacy bridge for improved performance and concurrency.

Common errors

Warnings

Install

Imports

Quickstart

Basic React Native component demonstrating UI elements, styling, and platform-specific adjustments for a 'Hello World' style application.

import React from 'react';
import { SafeAreaView, StyleSheet, Text, View, Platform, StatusBar } from 'react-native';

const App = () => {
  const os = Platform.OS === 'ios' ? 'iOS' : 'Android';

  return (
    <SafeAreaView style={styles.container}>
      <StatusBar barStyle="dark-content" />
      <View style={styles.content}>
        <Text style={styles.title}>Welcome to React Native!</Text>
        <Text style={styles.subtitle}>Running on {os} with v0.85.1</Text>
        <Text style={styles.description}>
          This is a basic React Native application. It demonstrates using core components
          like View, Text, and StyleSheet for UI layout and styling.
          The SafeAreaView ensures content is not obscured by device notches or status bars.
        </Text>
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#F8F8F8',
    paddingTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0,
  },
  content: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    padding: 20,
  },
  title: {
    fontSize: 28,
    fontWeight: 'bold',
    marginBottom: 10,
    color: '#333',
    textAlign: 'center',
  },
  subtitle: {
    fontSize: 18,
    color: '#666',
    marginBottom: 20,
    textAlign: 'center',
  },
  description: {
    fontSize: 16,
    color: '#555',
    lineHeight: 24,
    textAlign: 'center',
  },
});

export default App;

view raw JSON →