一覧へ戻る
taofed/react-web(新しいタブで開きます)
主要言語: JavaScript
A framework for building web apps with React Native compatible API.
- star 数
- 3,325
- watcher 数
- 3
- fork 数
- 435
- issue 数
- 43
- 最終更新
- 2019/12/10
主要言語: JavaScript
A framework for building web apps with React Native compatible API.
⚠️ Use react-native-web instead.
A library for building web apps with React Native compatible API.
npm install --save react-web
Inside your webpack configuration, alias the react-native package to the react-web package:
// webpack.config.js module.exports = { resolve: { alias: { 'react-native': 'react-web' } } }
import React, {Component} from 'react'; import {AppRegistry, StyleSheet, Text, View, Platform} from 'react-native'; class App extends 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); if (Platform.OS === 'web') { AppRegistry.runApplication('App', { rootTag: document.getElementById('app') }); }
React Web is BSD licensed.