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
580
「はやい、やすい、うまい?」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
700
stimulusの感触
masarutech
0
44
kawasakirb053
masarutech
0
5.4k
kawasakirb051
masarutech
0
440
Other Decks in Programming
See All in Programming
ドメイン駆動設計の実践
masuda220
PRO
19
5.2k
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
140
Microservices rules (July 2024) : what good looks like
cer
PRO
0
1.6k
君たちはどうコードをレビューする (される) か / 大吉祥寺.pm
utgwkk
15
8.5k
APIのない大学ログインWebサービスをWKWebViewとJavaScriptでアプリ化した話
akidon0000
1
330
DynamoDB コスト最適化っぽいことの基本 with Terraform
kuro_kurorrr
2
250
社内 LT 会を発足し、アウトプット文化を醸成させるために考えたこと・やったこと / Starting internal LT meetings and fostering an output culture
mackey0225
3
120
CSC307 Lecture 05
javiergs
PRO
0
210
Play Billing Library 7.0.0 変更点まとめ@potatotips#88
kako351
0
160
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
Introduction to GitOps
hwchiu
0
110
小さな開発会社を作った理由
polidog
0
1.9k
Featured
See All Featured
Thoughts on Productivity
jonyablonski
64
4.1k
Visualization
eitanlees
139
14k
Fantastic passwords and where to find them - at NoRuKo
philnash
42
2.7k
Faster Mobile Websites
deanohume
303
30k
Building Adaptive Systems
keathley
34
2k
Side Projects
sachag
451
42k
Designing with Data
zakiwarfel
96
5k
Into the Great Unknown - MozCon
thekraken
20
1.3k
Learning to Love Humans: Emotional Interface Design
aarron
269
39k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
YesSQL, Process and Tooling at Scale
rocio
166
14k
GitHub's CSS Performance
jonrohan
1026
450k
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อ࣋ͨ͠··
·ͱΊ ʮ͍ɺ͍͢ɺ͏·͍ʯ ↓ ʮ͍ɺ͍͢ɺΜΓʯͰͨ͠
͓ΘΓ ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠