Nicolas Gallagher 6ae68e948f [fix] ScrollView passive event listener warning
'touchstart' and 'touchmove' listeners added to the document will
default to 'passive:true' (so that calls to 'preventDefault' will be
ignored). Source https://www.chromestatus.com/features/5093566007214080

To support 'scrollEnabled', listeners are bound to the underlying
ScrollView DOM node to avoid being passive.

Fix #477
2017-06-11 14:39:42 -07:00
2017-06-05 19:51:34 -07:00
2017-06-09 12:59:39 -07:00
2017-06-09 11:56:14 -07:00
2017-05-25 23:10:37 -07:00
2017-05-24 15:21:25 -07:00
…
2017-06-09 16:52:14 -07:00
2017-06-09 14:50:03 -07:00
2017-05-24 15:21:25 -07:00
2017-06-09 12:59:39 -07:00

React Native for Web

Build Status npm version

React Native components and APIs for the Web.

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

Overview

"React Native for Web" is a project to bring React Native's building blocks and touch handling to the Web. Read more.

Browse the UI Explorer to see React Native examples running on Web. Or try it out online with React Native for Web: Playground.

Quick start

To install in your app:

npm install --save react@15.5 react-dom@15.5 react-native-web

Read the Getting Started guide.

Documentation

Guides:

Exported modules:

Why?

There are many different teams at Twitter building web applications with React. We want to share React components, libraries, and APIs between teams…much like the OSS community tries to do. At our scale, this involves dealing with multiple, inter-related problems including: component styles, animation, touch interactions, layout adaptation, accessibility, RTL layout, theming, and build- or server-rendering.

This is hard to do with React DOM, as the components are essentially the same low-level building blocks that the browser provides. However, React Native avoids, solves, or can solve almost all these problems. Central to this is React Native's JavaScript style API (not strictly "CSS-in-JS") which avoids the key problems with CSS by giving up some of the complexity of CSS.

Example code

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

// Components
const Card = ({ children }) => <View style={styles.card}>{children}</View>
const Title = ({ children }) => <Text style={styles.title}>{children}</Text>
const Photo = ({ uri }) => <Image source={{ uri }} style={styles.image} />
const App = () => (
  <Card>
    <Title>App Card</Title>
    <Photo uri="/some-photo.jpg" />
  </Card>
)

// Styles
const styles = StyleSheet.create({
  card: {
    flexGrow: 1,
    justifyContent: 'center'
  },
  title: {
    fontSize: '1.25rem',
    fontWeight: 'bold'
  },
  image: {
    height: 40,
    marginVertical: 10,
    width: 40
  }
})

// App registration and rendering
AppRegistry.registerComponent('MyApp', () => App)
AppRegistry.runApplication('MyApp', { rootTag: document.getElementById('react-root') })

License

React Native for Web is BSD licensed.

S
Description
Cross-platform React UI packages
Readme MIT
94 MiB
Languages
JavaScript 82.3%
CSS 9.5%
HTML 8.2%