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
140
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
1k
Rethink React in Elm
yhsiang
0
1k
開源與工程師的自我修養
yhsiang
0
170
Sayit in Taiwan
yhsiang
0
120
LY sayit
yhsiang
0
91
Webpack pack your web
yhsiang
17
12k
2015 Summer of ?
yhsiang
0
240
How to be a good wan-jun
yhsiang
1
120
Experience in building isomorphic app
yhsiang
11
700
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
610
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
cmp.Or に感動した
otakakot
2
140
Ethereum_.pdf
nekomatu
0
460
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
CSC509 Lecture 12
javiergs
PRO
0
160
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
210
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
ヤプリ新卒SREの オンボーディング
masaki12
0
130
初めてDefinitelyTypedにPRを出した話
syumai
0
400
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
290
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Designing Experiences People Love
moore
138
23k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
The Invisible Side of Design
smashingmag
298
50k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
A Philosophy of Restraint
colly
203
16k
GraphQLとの向き合い方2022年版
quramy
43
13k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
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]