Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taofed/react-web
A framework for building web apps with React Native compatible API.
https://github.com/taofed/react-web
react react-native
Last synced: 3 months ago
JSON representation
A framework for building web apps with React Native compatible API.
- Host: GitHub
- URL: https://github.com/taofed/react-web
- Owner: taofed
- License: other
- Archived: true
- Created: 2015-12-11T05:36:05.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T13:43:22.000Z (about 5 years ago)
- Last Synced: 2024-05-19T03:19:51.062Z (7 months ago)
- Topics: react, react-native
- Language: JavaScript
- Homepage:
- Size: 7.93 MB
- Stars: 3,361
- Watchers: 228
- Forks: 449
- Open Issues: 43
-
Metadata Files:
- Readme: README-zh.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - react-web
README
![react-web](https://cloud.githubusercontent.com/assets/677114/13032846/13118fe4-d33e-11e5-8ddd-4088e57a2eb2.png)
# React Web [![npm version](https://badge.fury.io/js/react-web.svg)](http://badge.fury.io/js/react-web)
> 通过 React Native 兼容的 API 构建无线 Web 应用
## 安装
```
npm install --save react-web
```## 使用
### 第一步:项目中修改 webpack 配置
在 webpack 配置中,需要添加 alias 将 `react-native` 指向 `react-web`:
```
// webpack.config.jsmodule.exports = {
resolve: {
alias: {
'react-native': 'react-web'
}
}
}
```### 第二步:使用 React Native API 写应用
```js
import React, {Component} from 'react';
import {AppRegistry, StyleSheet, Text, View, Platform} from 'react-native';class App extends Component {
render() {
return (
Hello, world!
);
}
}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') });
}
```## 兼容列表
* ActivityIndicator
* ART
* Button
* CheckBox
* FlatList
* Image
* ImageBackground
* KeyboardAvoidingView
* ListView
* Modal
* Picker
* ProgressBar
* RefreshControl
* SafeAreaView
* ScrollView
* SectionList
* Slider
* StatusBar
* Switch
* Text
* TextInput
* Touchable
* TouchableHighlight
* TouchableNativeFeedback
* TouchableOpacity
* TouchableWithoutFeedback
* View
* VirtualizedList
* WebView
* findNodeHandle
* AccessibilityInfo
* Alert
* Animated
* AppRegistry
* AppState
* AsyncStorage
* BackHandler
* Clipboard
* Dimensions
* Easing
* Geolocation
* I18nManager
* InteractionManager
* Keyboard
* LayoutAnimation
* Linking
* NetInfo
* PanResponder
* PixelRatio
* Platform
* Settings
* StyleSheet
* UIManager
* Vibration
* processColor
* NativeModules
* ColorPropType
* EdgeInsetsPropType
* PointPropType
* ViewPropTypes## 开源协议
React Web 基于 [BSD 开源协议](./LICENSE).