先附一個淘寶團隊做過的,不過好長時間沒更新了。http://taobaofed.org/blog/2016/03/11/react-web-intro/
注意:淘寶的需要降低node版本才可以使用,另外還需要單獨npm install react@版本 和 npm install react-dom@版本
正文
https://github.com/necolas/react-native-web
演示
你可以在這里找到React Native for Web和這個入門的演示。
快速集成 React Native Web
到今天為止,React Native for Web,讓我們稱之為RN4Web,仍然是最近的,可以使用一些更多的文檔,以及貢獻。
這個框架是試圖讓任何人更容易啟動,實驗和發布RN4Web應用程序。
安裝環境并下載框架
git clone https://github.com/grabcode/react-native-web-starter.git projectname
cd projectname
rm -rf .git
npm install
運行
npm run dev
然后就可以在 http://localhost:3000
下訪問React Native Web程序了
可用組件:
ActivityIndicator
Button
Image
ListView
ProgressBar
ScrollView
Switch
Text
TextInput
TouchableHighlight (mirrors React Native)
TouchableOpacity (mirrors React Native)
TouchableWithoutFeedback
View
APIs:
Animated (mirrors React Native)
AppRegistry
AppState
AsyncStorage
Clipboard
Dimensions
I18nManager
NativeMethods
NetInfo
PanResponder (mirrors React Native)
PixelRatio
Platform
StyleSheet
Vibration
你也可以享受[React Storybook](https://github.com/kadirahq/react-storybook)運行npm run storybook
并打開http://localhost:9001
Build
TODO
工具
React Native在瀏覽器中運行Web,因此開箱即用完全開發工具支持。
在未來,RN4Web Starter可能會有一些風格,如Redux及其驚人的[工具套件](https://github.com/gaearon/redux-devtools)。
關于 React Native Web
[React Native for Web](https://github.com/necolas/react-native-web)誕生于React Native社區成員的輝煌思想。 有些人會說,它必須發生,許多原因乞求這樣的項目開始。
React Native傾向于統一iOS和Android,很快通用Windows開發人員在一個橫幅下,就是原生的Wardens。
那么,在GoT類比之后,React Native for Web是萬維網,統一任何React開發者在一組通用的值。