Skip to content

Repository files navigation

React Native for Web

npm versionBuild StatusPRs Welcome

Compatibility: React Native 0.55.

"React Native for Web" makes it possible to run React Native components and APIs on the web using React DOM. Check out the live demo of the React Native examples running on the web.

  • 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, Playstation, Uber, The Times.

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

Quick start

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

For installation and configuration details please read the getting started guide.

Documentation

You can find the API documentation on the website.

Please refer to the React Native documentation for more design details, and for information about the Gesture Responder system and animations.

Guides

Examples

There are examples on the website (source code. And all the React Native examples (source code) are also available. Here is an example to get you started:

importReactfrom'react';import{AppRegistry,StyleSheet,Text,View}from'react-native';classAppextendsReact.Component{render(){return(<Viewstyle={styles.box}><Textstyle={styles.text}>Hello, world!</Text></View>);}}conststyles=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.

Integrations

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

Example recipes for web-specific UI patterns:

Compatibility with React Native

React Native v0.55

Components

NameStatusNotes
ActivityIndicatorAvailable
ARTAvailable
ButtonAvailable
CheckBoxAvailable
FlatListAvailable
ImageAvailable (partial)Missing multiple sources and HTTP headers.
ImageBackgroundAvailable
KeyboardAvoidingViewAvailable (mock)
ListViewAvailable
ModalNot started
PickerAvailable
RefreshControlNot started
SafeAreaViewAvailable
ScrollViewAvailable (partial)Missing momentum scroll events.
SectionListAvailable
SliderNot started
StatusBarMock
SwipeableFlatListAvailable
SwipeableListViewAvailable
SwitchAvailable
TextAvailable (partial)Missing onLongPress support.
TextInputAvailable (partial)Missing rich text features and auto-expanding behaviour.
TouchableAvailableIncludes additional support for mouse and keyboard interactions.
TouchableHighlightAvailable
TouchableNativeFeedbackNot started
TouchableOpacityAvailable
TouchableWithoutFeedbackAvailable
ViewAvailable
VirtualizedListAvailable
WebViewNot started
YellowBoxMock

Modules

NameStatusNotes
AccessibilityInfoMockNo equivalent web APIs.
AlertNot started
AnimatedAvailableMissing useNativeDriver support.
AppRegistryAvailableIncludes additional support for SSR with getApplication.
AppStateAvailable
AsyncStorageAvailable
BackHandlerMockNo equivalent web APIs.
CameraRollNot startedNo equivalent web APIs.
ClipboardAvailable
ColorPropTypeAvailable
DeviceInfoAvailable (partial)
DimensionsAvailable
EasingAvailable
EdgeInsetsPropTypeAvailable
GeolocationAvailable
I18nManagerAvailableIncludes additional support for runtime switch to RTL.
ImageEditorNot startedNo equivalent web APIs.
ImageStoreNot startedNo equivalent web APIs.
InteractionManagerAvailable (partial)
KeyboardMock
LayoutAnimationAvailable (partial)Missing transform to web animation.
LinkingAvailable
NativeEventEmitterAvailable
NativeMethodsMixinAvailable
NativeModulesAvailable (partial)Mocked. Missing ability to load native modules.
NetInfoAvailable (partial)Missing functionality to detect extensive connections.
PanResponderAvailable
PixelRatioAvailable
PlatformAvailable
PointPropTypeAvailable
SettingsNot started
ShareAvailableOnly available over HTTPS. Read about the Web Share API.
StyleSheetAvailable
TextPropTypesAvailable
UIManagerAvailable
VibrationAvailable
ViewPropTypesAvailable

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.

About

React Native for Web

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages