react-native-web

React Native for Web

React Native for Web

npm version Build Status PRs Welcome

Compatibility: React Native >= 0.60.

"React Native for Web" makes it possible to run React
Native
components and APIs on the web using React DOM.

  • High-quality web interfaces: makes it easy to
    create fast,
    adaptive web UIs in JavaScript. It provides native-quality interactions, support
    for multiple input modes (touch, mouse, keyboard), optimized vendor-prefixed
    styles, built-in support for RTL layout, built-in accessibility, and integrates
    with React Dev Tools.

  • Write once, render anywhere: interoperates with existing React DOM
    components and is compatible with the majority of the React Native API. You can
    develop new components for native and web without rewriting existing code.
    React Native for Web can also render to HTML and critical CSS on the server
    using Node.js.

Who is using React Native in production web apps?
Twitter,
Major League Soccer,
Flipkart,
Uber,
The Times,
DataCamp.

Browser support: Chrome, Firefox, Edge, Safari 7+, IE 10+.

Components and APIs deprecated in React Native are not supported by React Native for Web.

Quick start

The easiest way to get started is to edit this
CodeSandbox template. You don’t need to
install anything to try it out.

Documentation

The documentation app covers
installation, configuration, APIs, and guides.

The React Native documentation contains more information
about the Gesture Responder
system
,
animations, and
other design details.

Integrations

Examples of using React Native for Web with other web tools:

Examples

And here is a simple example to get you started. The documentation include
interactive examples and the source
code
is
also available.

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

class App extends React.Component {
  render() {
    return (
      <View style={styles.box}>
        <Text style={styles.text}>Hello, world!</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  box: { padding: 10 },
  text: { fontWeight: 'bold' }
});

AppRegistry.registerComponent('App', () => App);
AppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') });

This example will render the App into a container on the page.

You'll notice that there is no reference to react-dom; the App component is
defined using the platform-agnostic APIs and Components introduced by React
Native. This allows the app to be rendered to web and native platforms.

Compatibility with React Native

React Native v0.60

Components, Name, Status, Notes, :-----------------------, :-----, :----, ActivityIndicator, ✓, Button, ✓, CheckBox, ✓, FlatList, ✓, Image, ✓, Missing multiple sources (#515) and HTTP headers (#1019)., ImageBackground, ✓, KeyboardAvoidingView, (✓), Mock. No equivalent web APIs., Modal, ✘, Not started (#1020)., Picker, ✓, RefreshControl, ✘, Not started (#1027)., SafeAreaView, ✓, ScrollView, ✓, Missing momentum scroll events (#1021)., SectionList, ✓, StatusBar, (✓), Mock. No equivalent web APIs., Switch, ✓, Text, ✓, Missing onLongPress (#1011) support., TextInput, ✓, Missing rich text features (#1023), and auto-expanding behaviour (#795)., Touchable, ✓, Includes additional support for mouse and keyboard interactions., TouchableHighlight, ✓, TouchableNativeFeedback, ✘, Not started (#1024)., TouchableOpacity, ✓, TouchableWithoutFeedback, ✓, View, ✓, VirtualizedList, ✓, YellowBox, (✓), Mock. No YellowBox functionality., ### Modules, Name, Status, Notes, :-----------------------, :-----, :----, AccessibilityInfo, (✓), Mock. No equivalent web APIs., Alert, ✘, Not started (#1026)., Animated, ✓, Missing useNativeDriver support., AppRegistry, ✓, Includes additional support for server rendering with getApplication., AppState, ✓, BackHandler, (✓), Mock. No equivalent web APIs., Clipboard, ✓, DeviceInfo, (✓), Limited information., Dimensions, ✓, Easing, ✓, Geolocation, ✓, I18nManager, ✓, Includes additional support for runtime switch to RTL., InteractionManager, (✓), Keyboard, (✓), Mock., LayoutAnimation, (✓), Missing translation to web animations., Linking, ✓, NativeEventEmitter, ✓, NativeMethodsMixin, ✓, NativeModules, (✓), Mocked. Missing ability to load native modules., PanResponder, ✓, PixelRatio, ✓, Platform, ✓, Settings, ✘, No equivalent web APIs., Share, ✓, Only available over HTTPS. Read about the Web Share API., StyleSheet, ✓, UIManager, ✓, Vibration, ✓, ## Contributing

The main purpose of this repository is to help evolve React web and native
development towards the platform-agnostic design of React Native, and in the
process make it faster and easier to build high-quality experiences for the web
with React. Development happens in the open on GitHub, and we are grateful for
contributing bugfixes and improvements. Read below to learn how you can take
part in improving React Native for Web.

Code of conduct

Facebook has adopted a Code of Conduct that this project
expects all participants to adhere to. Please read the full text so that you
can understand what actions will and will not be tolerated.

Contributing guide

Read the contributing guide to learn about the
development process, how to propose bugfixes and improvements, and how to build
and test your changes to React Native for Web.

Good first issues

To help you get you familiar with the contribution process, there is a list of
good first issues that contain bugs which have a
relatively limited scope. This is a great place to get started.

License

React Native for Web is MIT licensed. By contributing to React
Native for Web, you agree that your contributions will be licensed under its
MIT license.

主要指标

概览
名称与所有者jitsi/jitsi-meet
主编程语言TypeScript
编程语言JavaScript (语言数: 13)
平台
许可证Apache License 2.0
所有者活动
创建于2013-12-16 12:51:09
推送于2025-07-22 13:56:28
最后一次提交2025-07-22 13:05:54
发布数17601
最新版本名称8733 (发布于 2025-07-22 10:18:36)
第一版名称214 (发布于 2014-10-22 13:18:38)
用户参与
星数26k
关注者数511
派生数7.3k
提交数13.3k
已启用问题?
问题数6691
打开的问题数115
拉请求数8005
打开的拉请求数31
关闭的拉请求数1444
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?