Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
React Native for Webのこれまでから読み解くReact GUIのこれから
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yukiya Nakagawa
October 02, 2021
Programming
6.6k
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React Native for Webのこれまでから読み解くReact GUIのこれから
React Native Matsuri 2021で発表したスライドです。
https://reactnative-matsuri.com/ja
Yukiya Nakagawa
October 02, 2021
More Decks by Yukiya Nakagawa
See All by Yukiya Nakagawa
AIがコードを書いてくれるなら、新米エンジニアは何をする? / komekaigi2025
nkzn
25
20k
JS Temporalを学ぶ人のための JSR-310入門 / jsr310-for-temporal
nkzn
0
110
Cloudflare Workers で作る専門性特化型 MCP サーバー / workers-specialist-mcp
nkzn
1
210
経済メディア編集部の実務に小さく刺さるAI / small-ai-with-editorial
nkzn
3
1.2k
Remix × Cloudflare Pages × Sentry 奮闘記 / remix-pages-sentry
nkzn
1
3k
Cloudflareスタックで月間1200万UUの経済メディアにアバター画像生成サービスを作る / Cloudflare Developer Platform for AI avatar service
nkzn
7
5.4k
5分で流し読むCloudflare Developer Platform
nkzn
3
490
次世代Web認証「パスキー」 / mo-zatsudan-passkey
nkzn
32
19k
パスキーについて今日時点の僕が知っていること / What I Know About Passkeys as of Today
nkzn
8
3.1k
Other Decks in Programming
See All in Programming
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
320
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.7k
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
280
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
280
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
4
2.8k
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
1
150
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
120
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
1k
What We Talk About When We Talk About XP
m_seki
2
630
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
A2UI for Android: Safely Rendering AI-Generated UI with Jetpack Compose - DroidKaigi 2026
itsmedreamwalker
0
140
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
170
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Skip the Path - Find Your Career Trail
mkilby
1
230
Writing Fast Ruby
sferik
630
63k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Mind Mapping
helmedeiros
1
360
The Cost Of JavaScript in 2023
addyosmani
55
10k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
430
The Language of Interfaces
destraynor
162
27k
Transcript
React Native for Webͷ ͜Ε·Ͱ͔ΒಡΈͱ͘ React GUIͷ͜Ε͔Β React Native Matsuri
2021 2021.10.2 Yukiya Nakagawa a.k.a Nkzn 1
Who am I • Yukiya Nakagawa a.k.a Nkzn (ͳ͔͟Μ) •
৽ׁࡏॅ • ೋࣇͷͰ࠺ͷʢࠓϫϯΦϖҭࣇ͋Γ͕ͱ͏🙏ʣ • ࢿ࢈ӡ༻͓ख͍αʔϏεmoneiroͷITཪํ • ٕज़ॻయͷWebϑϩϯτΤϯυˍܾࡁΞϓϦ୲ • React 2015ʙ / React Native 2017ʙ 2 0:38
2݄ʹຊ͕ग़·ͨ͠ https://amzn.to/3kWRYc0 • 2018͔Β2020Ն·Ͱ CodeZineͰ࿈ࡌ͍ͯͨ͠هࣄͷ૿ ิվగ൛Ͱ͢ • ExpoͰReactΛղઆͯ͠·͢ 3 0:57
DroidKaigiͰReact NativeͷΛͯͨ͠ਓͰ͢ • https://droidkaigi.github.io/2017/timetable.html • https://droidkaigi.jp/2018/timetable/ 4
React GUI͕ʹͳΓ·ͨ͠Ͷ 5
https://twitter.com/estejs/status/1414259301632385027 20217݄12ͷݯ 6 1:35
React GUI͞ΘͬͯΈͨ 7
https://ixrvy.sse.codesandbox.io/ 8 2:13
Hooks ΞϓϦέʔγϣϯ։ൃͰຯʹཱ ͪͦ͏ ϚεΩʔϘʔυͷಈ͖Λଊ͑Δ API͕๛ͳҹ 9 2:13
ྫ͑useHoverͰ͜Μͳ͜ͱ͕Ͱ͖Δ 10 2:51
useHover import React from "react"; import { useHover } from
"react-gui/use-hover"; export default function App() { const [hovered, onHoverChange] = React.useState(false); const ref = useHover({ onHoverChange }); return ( <div ref={ref} style={{ width: 200, height: 200, margin: "50px auto", border: "1px solid black", backgroundColor: hovered ? "orange" : null }} /> ); } • RefྖҬͷϗόʔΛݕग़ 11
͓·͚ useHoverState function useHoverState() { const [hovered, onHoverChange] = useState(false);
const ref = useHover({ onHoverChange }); return [ref, hovered]; } ͍͘͢ϥοϓ refͱhovered͚ͩެ։ 12
Components RNΤϯδχΞݟ͕֮͑͋Δฒͼ StyleSheet͋Δ͠ɺ·͋·͋େ ͷϨΠΞτ࡞Εͦ͏ 13 3:48
͜Μͳͷ࡞ͬͯΈΔ https://codesandbox.io/s/react-gui-preview-forked-xhws814
ͷإΑΓݟͨ React NativeͬΆ͞ export default function App() { const [ref,
hovered] = useHoverState(); return ( <View style={styles.container}> <View ref={ref} style={[ styles.card, { backgroundColor: hovered ? "#ffa" : "#fff" } ]} > <Image source={imageUrl} style={styles.thumbImg} /> <View style={{ justifyContent: "center" }}> <Text accessibilityRole="heading" accessibilityLevel={3} style={styles.title} > @Nkzn </Text> <View style={{ height: 8 }} /> <Text style={styles.description}> Matsuri 2021 Speaker </Text> </View> </View> </View> ); } • View, Text, Image • StyleSheet.create(ޙड़)Ͱ ࡞ͬͨstylesΛࢀর • ελΠϧΛྻͰϚʔδ 15 4:26
ͷإΑΓݟͨ React NativeͬΆ͞ export default function App() { const [ref,
hovered] = useHoverState(); return ( <View style={styles.container}> <View ref={ref} style={[ styles.card, { backgroundColor: hovered ? "#ffa" : "#fff" } ]} > <Image source={imageUrl} style={styles.thumbImg} /> <View style={{ justifyContent: "center" }}> <Text accessibilityRole="heading" accessibilityLevel={3} style={styles.title} > @Nkzn </Text> <View style={{ height: 8 }} /> <Text style={styles.description}> Matsuri 2021 Speaker </Text> </View> </View> </View> ); } • View, Text, Image • StyleSheet.create(ޙड़) Ͱ࡞ͬͨstylesΛࢀর • ελΠϧΛྻͰϚʔδ 16 4:45
ͷإΑΓݟͨ React NativeͬΆ͞ export default function App() { const [ref,
hovered] = useHoverState(); return ( <View style={styles.container}> <View ref={ref} style={[ styles.card, { backgroundColor: hovered ? "#ffa" : "#fff" } ]} > <Image source={imageUrl} style={styles.thumbImg} /> <View style={{ justifyContent: "center" }}> <Text accessibilityRole="heading" accessibilityLevel={3} style={styles.title} > @Nkzn </Text> <View style={{ height: 8 }} /> <Text style={styles.description}> Matsuri 2021 Speaker </Text> </View> </View> </View> ); } • View, Text, Image • StyleSheet.create(ޙड़)Ͱ ࡞ͬͨstylesΛࢀর • ελΠϧΛྻͰϚʔδ 17 5:04
ͷإΑΓ(ུ) const styles = StyleSheet.create({ container: { padding: 24, backgroundColor:
"#eee", height: "100vh" }, card: { boxShadow: "2px 2px 4px #ccc", padding: 16, backgroundColor: "#fff", borderRadius: 8, flexDirection: "row", maxWidth: 500, width: "100%", alignSelf: "center" }, thumbImg: { width: 100, height: 100, borderWidth: 1, borderColor: "#ccc", borderRadius: 50, marginRight: 16 }, title: { fontSize: 24, fontWeight: "700" }, description: { color: "#888" } }); ελΠϧʹ͑Δϓϩύ ςΟϥϯλΠϜґଘ shadowܥboxShadow ը૾Λؙ͘͢Δͷׂͱ͍ ͭ௨ΓͷΓํ 18 5:23
ͷإΑΓ(ུ) card: { boxShadow: "2px 2px 4px #ccc", padding: 16,
backgroundColor: "#fff", borderRadius: 8, flexDirection: "row", maxWidth: 500, width: "100%", alignSelf: "center" }, ελΠϧʹ͑Δϓϩύ ςΟϥϯλΠϜґଘ shadowܥboxShadow ը૾Λؙ͘͢Δͷׂͱ͍ ͭ௨ΓͷΓํ 19 5:42
ͷإΑΓ(ུ) thumbImg: { width: 100, height: 100, borderWidth: 1, borderColor:
"#ccc", borderRadius: 50, marginRight: 16 }, ελΠϧʹ͑Δϓϩύ ςΟϥϯλΠϜґଘ shadowܥboxShadow ը૾Λؙ͘͢Δͷׂͱ͍ ͭ௨ΓͷΓํ 20 6:01
React NativeͬΆ͘UI͕࡞ΕΔ ϒϥβ͚ϥΠϒϥϦͰͨ͠ 21
͍͔͕Ͱ͔ͨ͠ʁ ʢͬͯΈͨهࣄ෩ຯͷకΊʣ 22
23
Ξόϯऴྃ 24
ࠓͷ͓ • React GUIʹ৮ͬͯΈͨʢࠓऴΘͬͨʣ • React Native for Webͱ •
React Native for Webͳͥੜ·Εͨͷ͔ • React GUIͷ͜Ε͔Β 25 7:55
Aύʔτ 26
React Nativeͱ͍ۙॻ͖ຯͰ ϒϥβ͚ΞϓϦ͕࡞ΕΔੈք ૣ͘དྷͯ΄͍͠Ͱ͢ΑͶ 27
࣮ɺطʹ͋ΔΜͰ͢ 28
React Native for Web 29
https://necolas.github.io/react-native-web/ 30 9:30
ݟ͔֮͑͠ͳ͍ ※ ࡉ͔͍ݕূল͖·͕͢ɺαΠτͷจݴಉ͡෦͕ଟ͍Ͱ͢ 31
React GUIReact Native for Webͷܥේ • ͲͪΒ࡞ऀNicolas Gallagherࢯ • React
GUIFacebook໊͚ٛͩͲNPMͳͲͰࢯͷؔΘΓ͕ݟ͑Δ • https://www.npmjs.com/package/react-gui • React NativeͬΆ͍ίʔυΛϒϥβͰಈ͔͢Ξϓϩʔν 32 10:08
React Native for WebΛֶͿ͜ͱ React GUIΛֶͿ͜ͱʹܨ͕Δ 33
React Native for Web͓͞Β͍ᶃ • https://necolas.github.io/react-native-web/ • 20179݄ʹv0.1.0͕ެ։ • 20174݄ʹϦϦʔε͞ΕͨTwitter
Lite (mobile.twitter.com) Ͱ UIϥΠϒϥϦͱͯ͠࠾༻͞Εͨ • ࡞ऀͷNicolasࢯTwitter LiteϓϩδΣΫτ࣌ͷςοΫϦʔυ 34 10:46
https://twitter.com/necolas/status/913877194199359488 35
༨ஊɿTwitter Liteͷͦͷޙ • ॳεϚϗ͚ → λϒϨοτରԠ → σεΫτοϓରԠ → ݱࡏͷ
twitter.com 36
React Native for Web͓͞Β͍ᶄ • React Nativeͱ΄΅ಉ͡ ίϯϙʔωϯτͱAPIΛ࣋ͭ
JavaScriptͷUIϥΠϒϥϦ 37 11:43
React Native for Webͷ Α͋͘Δޡղ 38
“React Native for Web ϒϥβ্ʹReact NativeڥΛ࡞Δ ϥΠϒϥϦͰ͋Δ” ͜Εࣄ࣮Ͱ͋Γ·ͤΜ ʢ˞'MVUUFS8FC3FBDU/BUJWF%0.গ͚ͩͦ͠ΕͬΆ͍ΞϓϩʔνͰ͢ʣ 39
ʮReact Nativeʯͷ2ͭͷଆ໘ • UIϥΠϒϥϦͱͯ͠ͷReact Native • ϥϯλΠϜͱͯ͠ͷReact Native 40 12:40
UIϥΠϒϥϦͱͯ͠ͷReact Native import { Image, Text, View, StyleSheet } from
'react-native'; 41
UIϥΠϒϥϦͱͯ͠ͷReact Native • Reactͷίϯϙʔωϯτͱɺؔ܈ʢAPIʣ • ࠷ऴతʹωΠςΟϒϒϦοδ/JSIΛݺͼग़͢ͷͷɺͦΕҎ֎ͷ෦ ී௨ͷJavaScriptϥΠϒϥϦ 42 13:18
ϥϯλΠϜͱͯ͠ͷReact Native • ωΠςΟϒϓϥοτϑΥʔϜͷ্ͰJavaScriptΤϯδϯΛಈ͔͢ • ϒϦοδ/JSI͔Βͷߋ৽ґཔΛड͚ͯɺωΠςΟϒUIΛߋ৽͢Δ • ϒϦοδ/JSI͔Βͷݺͼग़͠Λड͚ͯɺωΠςΟϒॲཧΛ࣮ߦ͢Δ • ωΠςΟϒॲཧͷ݁ՌΛJavaScriptଆʹ௨͢Δ
43 13:37
"OESPJE J04 8JOEPXT "OESPJE4%, J044%, 7JTVBM$ 3/"OESPJE3VOUJNF 3/J043VOUJNF 3/8JOEPXT3VOUJNF 3/"OESPJE
/BUJWF$PNQPOFOUT"1*T 3/J04 /BUJWF$PNQPOFOUT"1*T 3/8JOEPXT /BUJWF$PNQPOFOUT"1*T 3FBDU/BUJWF+BWB4DSJQU"1* 0VS"XFTPNF"QQMJDBUJPO } } ϥϯλΠϜ (Java, Obj-C, C++) UIϥΠϒϥϦ (JavaScript) 44 13:56 $PNQPOFOU"1*ͷ /BUJWF࣮ +4*+4&OHJOF
React Native for Web͕࠶ݱͨ͠ͷ • UIϥΠϒϥϦͱͯ͠ͷReact Native • ϥϯλΠϜͱͯ͠ͷReact Native
ͪ͜Β 45
React Native for Webͷਖ਼ମ • React NativeϥϯλΠϜΛ࠶ݱ͠ͳ͍ • React Nativeͱಉ໊͡લɾಉ͡propsɾಉ͡ݟͨͷίϯϙʔωϯτ
͕ੜ͍͑ͯΔʢ෦࣮ͨͩͷdivspaninputʣ • React Nativeͱಉ໊͡લɾಉ͡Ҿɾಉ͡ڍಈͷAPI͕ੜ͍͑ͯΔ • ͨ·ͨ·React Nativeͱಉ͡ΠϯλʔϑΣʔεΛ͍࣋ͬͯΔ͚ͩͷɺ React Nativeͱґଘؔͷͳ͍UIϥΠϒϥϦ 46 14:34
"OESPJE J04 8JOEPXT "OESPJE4%, J044%, 7JTVBM$ 3/"OESPJE3VOUJNF 3/J043VOUJNF 3/8JOEPXT3VOUJNF 3/"OESPJE
/BUJWF$PNQPOFOUT"1*T 3/J04 /BUJWF$PNQPOFOUT"1*T 3/8JOEPXT /BUJWF$PNQPOFOUT"1*T 3FBDU/BUJWF+BWB4DSJQU"1* 0VS"XFTPNF"QQMJDBUJPO #SPXTFS %0."1*T #VJMUJO'VODUJPOT 3FBDU%0. 3FBDU/BUJWFGPS8FC $PNQPOFOUT"1*T 47 14:53
ͷإΑΓݟͨ React NativeͬΆ͞ export default function App() { const [ref,
hovered] = useHoverState(); return ( <View style={styles.container}> <View ref={ref} style={[ styles.card, { backgroundColor: hovered ? "#ffa" : "#fff" } ]} > <Image source={imageUrl} style={styles.thumbImg} /> <View style={{ justifyContent: "center" }}> <Text accessibilityRole="heading" accessibilityLevel={3} style={styles.title} > @Nkzn </Text> <View style={{ height: 8 }} /> <Text style={styles.description}> Matsuri 2021 Speaker </Text> </View> </View> </View> ); } • View, Text, Image • StyleSheet.create(ޙड़)Ͱ ࡞ͬͨstylesΛࢀর • ελΠϧΛྻͰϚʔδ ͜Ε͕3FBDU%0.ͰಡΊΔܗʹͳΔΘ͚Ͱ͢ 48
React Native for Webͷਖ਼ମ • React NativeϥϯλΠϜΛ࠶ݱ͠ͳ͍ • React Nativeͱಉ໊͡લɾಉ͡propsɾಉ͡ݟͨͷίϯϙʔωϯτ
͕ੜ͍͑ͯΔʢ෦࣮ͨͩͷdivspaninputʣ • React Nativeͱಉ໊͡લɾಉ͡Ҿɾಉ͡ڍಈͷAPI͕ੜ͍͑ͯΔ • ͨ·ͨ·React Nativeͱಉ͡ΠϯλʔϑΣʔεΛ͍࣋ͬͯΔ͚ͩͷɺ React NativeͱແؔͷUIϥΠϒϥϦ 2Ͳ͏࣮ͬͯݱ͍ͯ͠Δͷʁ 49
A. NicolasͷྗʹΑͬͯ • ͔ͭͯnormalize.cssΛ࡞͍ͬͯͨఔʹɺNicolasCSSͷঊ • ʮScrollViewͷଆʹpaddingΛ͚͍ͨ߹ contentContainerStyleΛ͍·͠ΐ͏ʯΈ͍ͨͳڍಈ·Ͱ࠶ݱ͞Εͯ ͍ΔʢڪΔ͖มଶͰ͋Δʣ • Yoga͕ͪΌΜͱϒϥβͷڍಈΛ࠶ݱͯ͘͠Ε͍ͯΔͷେ͖͍
50 15:50
React Native for WebͨͩͷUIϥΠϒϥϦ import { Image, Text, View, StyleSheet
} from ‘react-native-web’; XFCQBDLͷSFTPMWFBMJBTͰ ໊લΛޡຐԽͯ͠lSFBDUOBUJWFzͱͯ͠ *NQPSUͰ͖ΔΑ͏ʹ͍ͯ͠Δͷ͕&YQP8FC 51 16:09
Bύʔτ 52
React Native for Web ͳͥੜ·Εͨͷ͔ 53
React NativeΛ ϒϥβͰಈ͔͔ͨͬͨ͠ 54
ࢥ͍ग़ͯ͠΄͍͠ Twitter LiteTwitter WebۙԽPJ Twitter͕ࣾRNͷϢʔβʔاۀͩͱ ͍͏Λฉ͍ͨ͜ͱ͕͋Δਓʁ 55 17:25
React Native for Webͷ Ϟνϕʔγϣϯ ※ 20184݄͝ΖʹNicolas͕πΠʔτ͍ͯͨ͠Λݩʹ͍ͯ͠ΔͭΓͰ͕͢ɺ ۪ஒࠞ͡Γ͍͔ͩͬͨͤπΠফ͠͞Ε͍ͯΔͷͰɺશମతʹʦཁग़యʧͳ͜ͱΛ͝༰͍ࣻͩ͘͞ ※
͠ݟ͕֮͑͋Δͩͬͨ߹ɺTwitterͰʮݟ͕֮͑͋Δʯͱݴ͍͚ͬͯͨͩΔͱخ͍͠Ͱ͢ 56 17:44
ϒϥβຊདྷυΩϡϝϯτϏϡʔΞ http://info.cern.ch/hypertext/WWW/TheProject.html 57
GUIΞϓϦͷϓϥοτϑΥʔϜͱͯ͠ੜ·ΕͨΘ͚Ͱͳ͍ 58 EJWͱTQBOͱJNHʹ༷ʑͳ$44όουϊϋΛ༩ͯ͠ Α͏͘·ͱʹಈ͘ͷɺ(6*ϑϨʔϜϫʔΫͷମΛ͍ͯ͠ͳ͍ ʢϒϥβυΩϡϝϯτϏϡʔΞͳͷͰํͳ͍ʣ
ΞϓϦΛ࡞ΔͳΒ͜͏͍͏ͷཉ͍͠ΑͶ • ҙͷྖҬΛ׳ੑεΫϩʔϧ͍ͨ͠ • ॲཧͪͷϓϩάϨεόʔΛग़͍ͨ͠ • େྔͷσʔλΛলϝϞϦͰදࣔͰ͖ΔϦετػߏ ͪΖΜϥΠϒϥϦΛೖΕΕͰ͖Δ͚Ͳ ͜Μͳ͋Γ;ΕͨػೳΛೖΕΔ͚ͩͳͷʹ ϥΠϒϥϦͷબఆ؟͕ඞཁͳͷɺଟ͘ͷਓʹͱͬͯਏ͍
59 18:41
React DOM͚ͷ ඪ४GUIπʔϧΩοτ͕ཉ͍͠ ʢjQueryʹର͢ΔjQuery UIΈ͍ͨͳʣ 60
͓ɺ͜Μͳͱ͜Ζʹཧ͞ΕͨGUI͕ • ҙͷྖҬΛ׳ੑεΫϩʔϧ͍ͨ͠ • → ScrollView • ॲཧͪͷϓϩάϨεόʔΛग़͍ͨ͠ • →
ProgressBar, ActivityIndicator • େྔͷσʔλΛলϝϞϦͰදࣔͰ͖ΔϦετػߏ • → FlatList 61 19:19
React NativeͷAPIΑ͘Ͱ͖ͯΔʦཁग़యʧ • ͦͷདྷྺ͔ΒɺiOS SDKͱAndroid SDKͷ࠷େެΛࢤ͍ͯ͠Δ • iOSઌߦͰ࡞ΒΕͨͷͰɺ໋໊͕iOSدΓͰ͋Δ • for
Windowsfor macOS͕࣮͞Ε͔ͨΒAPIσβΠϯͷ൚༻ੑ ͕Ӑ͍ΕΔʢ΄Μͱ͔……ʁʣ • GUIΞϓϦέʔγϣϯ࡞Γʹదͨ͠ϑϨʔϜϫʔΫΛ࡞ΔͳΒɺAPI ͱͯ͠React NativeΛਅࣅΔͷѱ͘ͳ͍Ξϓϩʔν 62 19:38
React Native for WebͷϞνϕʔγϣϯ React DOM͚ͷ ඪ४GUIπʔϧΩοτͱͯ͠ React NativeΫϩʔϯΛ࡞Ζ͏ʂ 63
ͷإΑΓݟͨ React NativeͬΆ͞ export default function App() { const [ref,
hovered] = useHoverState(); return ( <View style={styles.container}> <View ref={ref} style={[ styles.card, { backgroundColor: hovered ? "#ffa" : "#fff" } ]} > <Image source={imageUrl} style={styles.thumbImg} /> <View style={{ justifyContent: "center" }}> <Text accessibilityRole="heading" accessibilityLevel={3} style={styles.title} > @Nkzn </Text> <View style={{ height: 8 }} /> <Text style={styles.description}> Matsuri 2021 Speaker </Text> </View> </View> </View> ); } • View, Text, Image • StyleSheet.create(ޙड़)Ͱ ࡞ͬͨstylesΛࢀর • ελΠϧΛྻͰϚʔδ Ͱɺ͜͏ͳͬͨΘ͚ 64
React Native for WebͷϞνϕʔγϣϯ • React DOMͷੈքʹશ෦ೖΓGUIπʔϧΩοτ͕ཉ͍͠ • ෳϓϥοτϑΥʔϜͷதͰୟ্͖͛ΒΕͨɺReact NativeͷதཱతͳAPIσβΠϯ
ΛϒϥβʹऔΓࠐΜͰΈΑ͏ • CSSͷࠇຐज़Λ֮͑ͳͯ͘ҰൠతͳGUIΞϓϦέʔγϣϯΛΊΔΑ͏ʹͳΔͧʂ • ͦΕͰ͍ͯσβΠϯ্ͷΦϐχΦϯͳ͍ͷͰɺ͖ͳσβΠϯͷUIϥΠϒϥϦΛඃ ͤΒΕΔͧʂʢReact Native Paperͱ͔NativeBaseͱ͔͑Δʣ • WAI-ARIA༷ͷAccessibilityରԠ͕Γ͍͢Α͏ʹྀ͢Δ $IBLSB6*ͱͷҧ͍ 65 20:35
Accessibility React NativeຊՈͷaccessibilityܥ APIΛΞϨϯδͨ͠ܗͰɺWAI-ARIA ରԠηϚϯςΟοΫWebରԠΛ ߦ͍ͬͯΔ 66 20:54
StyleSheet ελΠϧՄೳͳݶΓখׂ͘͞͞ ΕͯɺελΠϧͷ༰͔Βੜ͞Ε ͨΫϥε໊Λ༩͑ΒΕΔ ՄೳͳݶΓॏෳഉআ͞ΕΔͷͰόϯ υϧੑೳ͕ߴ͍ ༗໊ແ࣮Խͨ͠ɺຊՈͷ StyleSheet.createΑΓ༏ल 67 21:13
ग़ϋονͷ ࡞Γ͢͞ import React, { useCallback } from 'react'; import
{ View } from 'react-native'; import { useDropzone } from 'react-dropzone'; export type Props = { onFileSelected: (file: File) => void; }; export const UploadProductDlc: React.FC<Props> = ({ onFileSelected }) => { const onDrop = useCallback( (acceptedFiles) => { if (!acceptedFiles || acceptedFiles.length === 0) return; onFileSelected(acceptedFiles[0]); }, [onFileSelected] ); const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, accept: [ 'application/pdf' ], }); return ( <View> <div {...getRootProps()} style={{ backgroundColor: isDragActive ? 'lightgray' : ‘gray' }} > <input {...getInputProps()} /> <p>ϑΝΠϧΛՃ͢Δ (࠷େ500MB·Ͱʣ</p> </div> </View> ); }; React Nativeͷख๏Ͱղܾ͢Δͷ ͕໘ʹͳͬͨΒɺϒϥβͷख ๏ʹಀ͍͍͛ͯ ීஈͱҧͬͯϒϦοδ͕͍Βͳ͍ ࣮ՈͷΑ͏ͳ҆৺ײ ϒϥβ͚ϥΠϒϥϦ 7JFXͷதʹEJWΛஔ͍͍͍ͯ UploadProductDlc.web.tsx 68 21:32
ٕज़ॻయWebͰ࣮ࡍʹ͍ͬͯ·͢ 69 21:51
Αͦ͞͏ 70
͔͠͠React Native for Web ʮReact Nativeʯ ͱ͍͏໊લͰଛ͕ͪ͠ 71 22:29
React NativeϥϯλΠϜͷͨΊͷ πʔϧͩͱצҧ͍͞Εͯ Web։ൃऀʹݟ͖͞Εͳ͍ ʢʮຊసͩʯͱ͍͏ẍস·ͰඈΜͰ͘Δ࢝ʣ ʢNicolas͕۪ஒͬͯπΠফ͢͠ΔݪҼʣ 72 22:48
- 2018.3.6 @Necolas “React Native͕ɺWeb։ൃऀʹͱͬͯ࠷͠ ͍GUIͷͷଟ͘Λ͢Ͱʹղܾ͍ͯ͠Δ͜ͱ ΛɺͲ͏ͬͯWeb։ൃऀʹೲಘͤ͞Δͷ͔ʁ աڈʹͬͯɺReact DOMͷલʹReact NativeΛ
ϦϦʔε͢Δʁͬͱ؆୯ͳํ๏ͳ͍ͷ͔…” 73 23:07 https://twilog.org/Nkzn/date-180306
·໋໊͕͋ѱ͍ • ໊લ͕Ͳ͏ͯ͠ΠϩϞϊײΛग़ͯ͠͠·͏ • Nicolas໊લͷѱ͞Θ͔͍ͬͯΔΑ͏ͩͬͨʦཁग़యʧ • ʮ͍ͬͦReact Nativeଆ໊͕લΛม͑ͯ͘ΕͨΒ͍͍ʯ·Ͱݴͬͯͨ ؾ͕͢Δ
ʢUIϥΠϒϥϦͱͯ͠ͷReact Nativeʹผͷ໊લΛ͚ͭͯ΄͍͠ɺ ɹ͘Β͍ͷχϡΞϯεʣ 74 23:26
ReactʹGUIπʔϧΩοτ͕ඞཁ 75
ReactʹGUIπʔϧΩοτ͕ඞཁ React GUI 76
React GUI 77
React GUI React Native for Webͷҟੈքసੜ ʢ͔͠Εͳ͍ʣ 78 24:42
Cύʔτ 79
React GUI React Native for Webͷ ϦϒϥϯσΟϯάͳͷ͔ 80
Θ͟Θ͟Facebook໊ٛͰग़ͯ͜ΒΕΔͱ ظߴ·Δͱ͍͏ͷ 81
ظ͕ߴ·Γ͗ͯ͢DiscussionΛཱͯͨਓ͕͍·ͨ͠ https://github.com/reactwg/react-18/discussions/71 82
ޚେ͔Βͷճ ·ͩݸਓతͳ࣮ݧϓϩδΣΫτͰ͋Δ FBͷؒͱڞ༗ͨͯ͘͠FBͷϦϙδτϦʹ্͚͛ͨͩ ΦϑΟγϟϧʹͳΔ༧ఆ·ͩͳ͍ ͍͔ͭ͘ͷΞΠσΞReact Native for WebʹϑΟʔυόοΫͨ͠Γ React
NativeνʔϜͱ͠߹ͬͨΓ͍ͯ͠Δ 83 26:17
·ͩReact GUIͷ࣌དྷͳ͍Β͍͠ 84
React GUIʹظ͢Δະདྷ 85
React NativeͷΈͰͰ͖ͳ͔ͬͨ͜ͱ • iOSAndroidͱ͍ͬͨλονσόΠεΛલఏʹ࡞ΒΕͨͨΊɺ ϙΠϯςΟϯάσόΠεͷߟྀ͕͔ͳΓബ͍ • ೖྗͷϑΥʔΧεҠಈΩʔϘʔυγϣʔτΧοτɺΟϯυαΠ ζͷΧδϡΞϧͳมߋͳͲಉ༷ •
React NativeͷAPI͔Βେ͖͘ҳ͢Δ͜ͱͰ͖ͳ͍தͰରԠʹ ݶ͕͋ͬͨʢ@types/react-nativeͰܕ͚ͯ͠Δ͠Ͷʣ 86 27:14
React GUIͳΒͰ͖Δ σεΫτοϓ͚Hooksͷݟຊࢢ React Native for WebͰΓ͔ͬ ͨΜͩΖ͏ͳ͋…… 87
طଘͷRNϑΝϛϦʔϙΠϯςΟϯάσόΠε ͱແؔͰͳ͍ https://microsoft.github.io/react-native-windows/ https://www.gizmodo.jp/2020/03/ipados-13-4-release.html https://www.google.co.jp/intl/ja_jp/chromebook/ 88 27:52
͔ͯ͠͠ • React NativeνʔϜʹϑΟʔυόοΫ͍ͯ͠Δ༰ͱ͍͏ͷɺ ϙΠϯςΟϯάσόΠεͷσεΫτοϓ͚API……ʁ • useHoverΛReact NativeຊମʹऔΓࠐ·ͤͯɺReact Native
for WebΛΑΓσεΫτοϓ͚ʹਐԽͤ͞ΔͭΓͰ……ʁ • ͠ΒΜ͚Ͳ 89 28:11
React Native for Web ެࣜΞΧϯτΛνΣοΫ https://twitter.com/ReactWeb 8/27ʹͰ͖ͯͨ @ReactNativeWebʹ͠ͳ͔ͬͨ͋ͨΓ ʹNicolasͷࣥ೦Λײ͡Δ
͍͔ͭReact Native for WebͱReact GUI ͕౷߹ͯ͠React WebʹͳΔΜͩΖ͏͔ 90 28:30
͔͜͜Βઌ܅ͷͰ͔֬Ίͯ͘Εʂ 91