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
「はやい、やすい、うまい?」React Native
Search
masaru-tech
April 26, 2017
Programming
1
600
「はやい、やすい、うまい?」React Native
kawasaki.rb #047の発表スライドです。
masaru-tech
April 26, 2017
Tweet
Share
More Decks by masaru-tech
See All by masaru-tech
Sidekiqでクラスターモードは使えるのか? / kawasakirb_060
masarutech
0
770
stimulusの感触
masarutech
0
45
kawasakirb053
masarutech
0
5.5k
kawasakirb051
masarutech
0
480
Other Decks in Programming
See All in Programming
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
610
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
return文におけるstd::moveについて
onihusube
1
610
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
130
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
선언형 UI에서의 상태관리
l2hyunwoo
0
130
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
920
CSC305 Lecture 26
javiergs
PRO
0
140
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
160
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
890
Featured
See All Featured
Visualization
eitanlees
146
15k
Designing for Performance
lara
604
68k
A Tale of Four Properties
chriscoyier
157
23k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
The Cult of Friendly URLs
andyhume
78
6.1k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.3k
Automating Front-end Workflow
addyosmani
1366
200k
Making the Leap to Tech Lead
cromwellryan
133
9k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Transcript
ʮ͍ɺ͍͢ɺ͏·͍ʁʯ React Native kawasaki.rb #047 @MasaruTech
ΞδΣϯμ ▸ ࣗݾհ ▸ React Nativeͱ ▸ ͍ ▸ ͍͢
▸ ͏·͍ʁ
ࣗݾհ ▸ Rails͓ͬͯࣄͯ͠ΔΤοεΞΠΞʔ ▸ kawasaki.rb#046͔ΒࢀՃ ▸ ͜͜2ϲ݄ͪΐͬͱϓϥΠϕʔτͰReact NativeΛͬͯ ΞϓϦΛ࡞ͬͯΈ͍ͯΔͱ͜Ζ ▸
Swift/Xcodeॳ৺ऀɺAndroidະܦݧ େఉɹকʢΦΦόɹϚαϧʣ
React Native
React Nativeͱ ▸ FacebookͷReact.jsϕʔεͰωΠςΟϒΞϓϦ͕࡞Ͱ͖ ΔϑϨʔϜϫʔΫ (React 3ܑఋͷ࣍உ) ▸ Webͷࣝ/ٕज़(JS, CSS
LikeͳStyle, npm)Ͱ։ൃͰ͖Δ ▸ ΫϩεϓϥοτϑΥʔϜͰͳ͍ (Learn once, write anywhereɿҰֶɺͲ͜Ͱॻ͚Δ)
͍ɺ͍͢ɺ͏·͍ʁ
͍
։ൃ͍ ▸ ίϯύΠϧॳճىಈ࣌ͷΈ Ҏ߱ίʔυΛมߋͯ͠࠶ίϯύΠϧͤͣʹߋ৽Մೳ ▸ npmͷϥΠϒϥϦ͕͑Δ ▸ ωΠςΟϒͷAPIΒͳͯ͘Կͱ͔ͳΔ ެࣜͷυΩϡϝϯτಡΊେମͲ͏ʹ͔ɾɾɾ ▸
σόοά׳ΕͨChromeͷDeveloper Tool͕͑Δ
ಈ࡞͍ ▸ UIωΠςΟϒଆͰඳը͞ΕΔ ωΠςΟϒͷUIΛJS͕ίϯτϩʔϧ ▸ ListɺύϑΥʔϚϯεͷ࠷దԽ͕͞Ε͍ͯΔ ▸ JSͰΰϦΰϦʹॲཧΛॻ͘ͱ͘ͳΔ(Β͍͠)
͍͢
͡Ί͍͢ ▸ JSͰهड़͢ΔͷͰɺWebͷࣝ͑͋͞Εswift/javaΛΒ ͳͯ͘ΞϓϦΛ࡞ΕΔ ▸ BabelReact Native͕Α͠ͳʹͯ͘͠ΕΔͷͰɺReact.jsͷ Α͏ʹઃఆΛؾʹͤͣES2015/2016Ͱॻ͚Δ
ViewΛΈ͍͢ ▸ ͜Εʹਚ͖Δ ▸ ॳ৺ऀʹSwiftɺXcodeͷIB(Interface Builder)ͰViewΛ Ήͷ͍͠ UIܥΛશͯIBͰࢦఆͰ͖ͳ͍ɻɻɻ ▸ CSSʹࣅͨهड़Ͱॻ͚ΔͷͰWebͷΑ͏ʹσβΠϯ͕Ͱ͖Δ
Viewͷྫ return ( <View style={styles.container}> <Image style={styles.thumbnail} source={{uri: "https://pbs.twimg.com/profile_images/ xxxxxxxxx.jpeg"}}/>
<View style={styles.mainContainer}> <View style={styles.header}> <View style={styles.userInfo}> <Text style={styles.username}> {item.username} </Text> <Text style={styles.accountNo}> {item.accountNo} </Text> </View> <View> <Text style={styles.postedAt}> {item.postedAt} </Text> </View> </View> <View style={styles.messageContainer}> <Text> {item.message} </Text> </View> </View> </View> );
const styles = StyleSheet.create({ container: { padding: 10, borderBottomColor: '#ededed',
borderBottomWidth: 1, backgroundColor: 'transparent', flexDirection: 'row', }, thumbnail: { width: 34, height: 34, borderRadius: 17 }, mainContainer: { flex: 1, flexDirection: 'column', marginLeft: 10, }, header: { flexDirection: 'row', }, userInfo: { flex: 1, flexDirection: 'row' }, username: { fontSize: normalize(16), color: colors.grey1, fontWeight: '800' }, accountNo: { color: colors.grey3, fontSize: normalize(12), marginLeft: 5, marginTop: 3 }, postedAt: { color: colors.grey3, fontSize: normalize(12), marginTop: 3 }, messageContainer: { flexDirection: 'row', marginTop: 10 }, });
͏·͍ʁ
͏·͍Ͱʒ͔͕ͨͬͨࢥ͍͔ͭͳ͔ͬͨ ͳͷͰศརͳϦϩʔυػೳΛհ
Ϧϩʔυ ▸ Reload(⌘+R) ௨ৗͷϦϩʔυ ▸ Live Reload ϑΝΠϧʹมߋ͕͋ΔͱࣗಈͰϦϩʔυ State͕ॳظঢ়ଶʹͳΔ ▸
Hot Reload ϑΝΠϧʹมߋ͕͋ΔͱࣗಈͰϦϩʔυ Stateอ࣋ͨ͠··
·ͱΊ ʮ͍ɺ͍͢ɺ͏·͍ʯ ↓ ʮ͍ɺ͍͢ɺΜΓʯͰͨ͠
͓ΘΓ ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠