Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
From React to React Native Web
Search
Yuanhsiang Cheng
November 20, 2019
Programming
0
190
From React to React Native Web
Yuanhsiang Cheng
November 20, 2019
Tweet
Share
More Decks by Yuanhsiang Cheng
See All by Yuanhsiang Cheng
How to rebuild a websocket service by golang and redis
yhsiang
0
1.1k
Rethink React in Elm
yhsiang
0
1.1k
開源與工程師的自我修養
yhsiang
0
200
Sayit in Taiwan
yhsiang
0
170
LY sayit
yhsiang
0
140
Webpack pack your web
yhsiang
17
12k
2015 Summer of ?
yhsiang
0
300
How to be a good wan-jun
yhsiang
1
160
Experience in building isomorphic app
yhsiang
11
760
Other Decks in Programming
See All in Programming
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
6k
dchart: charts from deck markup
ajstarks
3
990
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
600
CSC307 Lecture 03
javiergs
PRO
1
490
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
CSC307 Lecture 05
javiergs
PRO
0
500
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
30 Presentation Tips
portentint
PRO
1
210
How to Ace a Technical Interview
jacobian
281
24k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Docker and Python
trallard
47
3.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Accessibility Awareness
sabderemane
0
49
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Paper Plane (Part 1)
katiecoart
PRO
0
4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Transcript
From React to React Native Web LY Cheng @ Maicoin
HQ 2019.11.20
Agenda • React Native Web introduction • Why React Native
Web • How MaiCoin use RNW
React Native • March 26, 2015 • Learn once, write
anywhere.
Expo • A framework and a platform for universal React
applications
RN Code example
React Native Web • Author: Nicolas https://github.com/necolas • July 6,
2015 • Write once, render anywhere.
Who use RNW • Twitter, Major League Soccer, Flipkart, Uber,
The times, DataCamp • MaiCoin!
Twitter use RNW
Twitter use RNW
Twitter use RNW
RNW Setup • npm install react react-dom react-native-web • webpack.config.js
RNW Setup • Babel module-resolver: alias: "^react-native$": "react-native-web" • Jest
preset: "react-native-web" • Flow module.name_mapper='^react-native$' -> 'react-native-web'
RNW Code example
Problems we met • Shim modules • Native only: Alert
-> window.alert • Web only: 3rd library • Platform workaround • TouchableOpacity: onPress -> onClick • React navigation • Screen Path -> URL query string
Problems we met • Device detection • Cookie • Header
• Flexbox • Flex: 1 vs flexGrow: 1
UI Abstraction
UI Abstraction • State disable onPress
UI Abstraction • Style textColor backgroundColor
UI Abstraction • Theme colors set
UI Abstraction • Renderer
UI Abstraction
MAX • Rails backend • React native app • React
Redux • Progressive React native web app • Assets page (https://max.maicoin.com/funds) • History page (https://max.maicoin.com/history/orders) • Trading page (https://max.maicoin.com/trades/btctwd)
MAX
MAX
MAX
MAX
MaiCoin • Rails backend • GraphQL API gateway • React
native app • React native web app (for mobile only) • https://maicoin.com
MaiCoin
MaiCoin
MaiCoin
React Native Web • Pros • Codebase consistent • Development
experience • No more CSS methodology • Cons • Upstream bugs • Cross platform testing
Special Thanks • MaiCoin Frontend Team • a9 • chunghe
• evelyn • MaiCoin QA Team • MaiCoin & MAX users
We Are Hiring • Frontend Engineer React, React Native, React
Native Web GraphQL, React Redux, Rails •
[email protected]