{"id":13671545,"url":"https://github.com/taofed/react-web","last_synced_at":"2025-09-27T07:32:16.490Z","repository":{"id":57347565,"uuid":"47807407","full_name":"taofed/react-web","owner":"taofed","description":"A framework for building web apps with React Native compatible API.","archived":true,"fork":false,"pushed_at":"2019-12-10T13:43:22.000Z","size":8314,"stargazers_count":3361,"open_issues_count":43,"forks_count":449,"subscribers_count":228,"default_branch":"master","last_synced_at":"2024-05-19T03:19:51.062Z","etag":null,"topics":["react","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taofed.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-11T05:36:05.000Z","updated_at":"2024-05-13T11:58:16.000Z","dependencies_parsed_at":"2022-08-28T03:01:30.046Z","dependency_job_id":null,"html_url":"https://github.com/taofed/react-web","commit_stats":null,"previous_names":["taobaofed/react-web"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taofed%2Freact-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taofed%2Freact-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taofed%2Freact-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taofed%2Freact-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taofed","download_url":"https://codeload.github.com/taofed/react-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410348,"owners_count":18828187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-native"],"created_at":"2024-08-02T09:01:12.602Z","updated_at":"2025-09-27T07:32:06.870Z","avatar_url":"https://github.com/taofed.png","language":"JavaScript","readme":"![react-web](https://cloud.githubusercontent.com/assets/677114/13032846/13118fe4-d33e-11e5-8ddd-4088e57a2eb2.png)\n\n# React Web [![npm version](https://badge.fury.io/js/react-web.svg)](http://badge.fury.io/js/react-web)\n\n\u003e 通过 React Native 兼容的 API 构建无线 Web 应用\n\n## 安装\n\n```\nnpm install --save react-web\n```\n\n## 使用\n\n### 第一步：项目中修改 webpack 配置\n\n在 webpack 配置中，需要添加 alias 将 `react-native` 指向 `react-web`:\n\n```\n// webpack.config.js\n\nmodule.exports = {\n  resolve: {\n    alias: {\n      'react-native': 'react-web'\n    }\n  }\n}\n```\n\n### 第二步：使用 React Native API 写应用\n\n```js\nimport React, {Component} from 'react';\nimport {AppRegistry, StyleSheet, Text, View, Platform} from 'react-native';\n\nclass App extends Component {\n  render() {\n    return (\n      \u003cView style={styles.box}\u003e\n        \u003cText style={styles.text}\u003eHello, world!\u003c/Text\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  box: {padding: 10},\n  text: {fontWeight: 'bold'}\n});\n\nAppRegistry.registerComponent('App', () =\u003e App);\n\nif (Platform.OS === 'web') {\n  AppRegistry.runApplication('App', { rootTag: document.getElementById('app') });\n}\n```\n\n## 兼容列表\n\n* ActivityIndicator\n* ART\n* Button\n* CheckBox\n* FlatList\n* Image\n* ImageBackground\n* KeyboardAvoidingView\n* ListView\n* Modal\n* Picker\n* ProgressBar\n* RefreshControl\n* SafeAreaView\n* ScrollView\n* SectionList\n* Slider\n* StatusBar\n* Switch\n* Text\n* TextInput\n* Touchable\n* TouchableHighlight\n* TouchableNativeFeedback\n* TouchableOpacity\n* TouchableWithoutFeedback\n* View\n* VirtualizedList\n* WebView\n* findNodeHandle\n* AccessibilityInfo\n* Alert\n* Animated\n* AppRegistry\n* AppState\n* AsyncStorage\n* BackHandler\n* Clipboard\n* Dimensions\n* Easing\n* Geolocation\n* I18nManager\n* InteractionManager\n* Keyboard\n* LayoutAnimation\n* Linking\n* NetInfo\n* PanResponder\n* PixelRatio\n* Platform\n* Settings\n* StyleSheet\n* UIManager\n* Vibration\n* processColor\n* NativeModules\n* ColorPropType\n* EdgeInsetsPropType\n* PointPropType\n* ViewPropTypes\n\n## 开源协议\n\nReact Web 基于 [BSD 开源协议](./LICENSE).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaofed%2Freact-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaofed%2Freact-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaofed%2Freact-web/lists"}