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
Native開発者から見たReactNative
Search
y_matsuwitter
March 31, 2015
Programming
8k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Native開発者から見たReactNative
at Gunosy React Meetup
y_matsuwitter
March 31, 2015
More Decks by y_matsuwitter
See All by y_matsuwitter
LLMと共に進化するプロセスを目指して
ymatsuwitter
13
4.8k
Building Products in the LLM Era
ymatsuwitter
11
13k
Product Utilization of Large Language Models Starting Today
ymatsuwitter
3
3.4k
経営・意思・エンジニアリング
ymatsuwitter
23
22k
LLM in 2023 and 2024
ymatsuwitter
8
6.3k
Turbulent Technological Changes and Career Strategies
ymatsuwitter
2
3.2k
LLM in toB Service and Its UX
ymatsuwitter
7
12k
Agent and small LLM validation
ymatsuwitter
7
3.1k
Information management for a culture of speed: The story of Notion and LayerX
ymatsuwitter
4
11k
Other Decks in Programming
See All in Programming
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
250
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
450
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
160
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
120
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
120
関数型プログラミングのメリットって何だろう?
wanko_it
0
140
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.9k
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
100
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
180
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
430
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
1
230
初めてのKubernetes 本番運用でハマった話
oku053
0
120
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Thoughts on Productivity
jonyablonski
76
5.2k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
230
Skip the Path - Find Your Career Trail
mkilby
1
160
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
63
55k
The Curse of the Amulet
leimatthew05
2
13k
Fireside Chat
paigeccino
42
4k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
220
Transcript
Na#veApp։ൃऀ͔ΒΈͨ ReactNa#ve
Who$am$I? • ։ൃຊ෦ࣥߦһࡶ༻ • iOS,&Android,&Infrastructure,&Web • Golangڭ • ਖ਼࠲ •
࠷ۙؾʹͳΔͷ:&MQTT
ωΠςΟϒ։ൃͰͷελϯε • ωΠςΟϒΞϓϦ֤Pla%orm͝ͱʹ࠷దԽࣗͰΔ • ΫϩεϓϥοτϑΥʔϜʹເݟͳ͍
ReactNa'veͱ • ReactjsϕʔεͰωΠςΟϒΞϓϦ։ൃΛߦ͏ͨΊͷπʔϧηο τɻ • Not+only+for+DOM,+But+for+any+Views. • 03/27ʹɺiOS͚͕ϦϦʔε
ViewͷநԽ • Na$veଆͰjsx*<=>*Na$veͷViewͷมΛߦ͏ • iOSͰjsxΛUIKitʹม͍ͯ͠Δ༷ • ྨࣅ:*ReactCanvas*(jsx*<=>*Canvas)
ReactNa'veΛݟͯΈΑ͏ QiitaͷReactjsλάϦʔμʔΛ࡞ͬͯΈΔ
֤छϞδϡʔϧͷϩʔυ 'use strict'; var React = require('react-native'); var { AppRegistry,
// ΞϓϦͷىಈϙΠϯτ StyleSheet, // ֤ཁૉͷελΠϧ Text, // ςΩετϥϕϧ View, // View ListView, // Ϧετ Image, // ը૾View NavigatorIOS, // iOSͷUINavigationController TouchableWithoutFeedback, //λονΠϕϯτͷऔಘ WebView // WebView } = React; var QIITA_URL = "https://qiita.com/api/v2/tags/reactjs/items";
φϏήʔγϣϯͷఆٛ • ΞϓϦ͕࠷ॳʹىಈ͢ΔViewControllerͱͯ͠ࠓճNaviga0on Λͬͨ // ϕʔεͷUINavigationControllerʹ֘͢Δͷ var ReactQiitaNavigator = React.createClass({
render: function() { return ( <NavigatorIOS style={styles.navigator} initialRoute={{ component: ReactQiitaList, title: 'ReactQiita', }}/> ); } })
Listදࣔ:&ॳظԽ // هࣄҰཡϦετ var ReactQiitaList = React.createClass({ getInitialState: function() {
return { items: new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }), loaded: false, }; }, componentDidMount: function() { this.fetchData(); //σʔλͷऔಘʢޙड़ʣ },
ListView:)શମඳը render: function() { if (!this.state.loaded) { // ಡΈࠐΈϏϡʔͷඳըʢࠓճઆ໌লུʣ return
this.renderLoadingView(); } return ( <ListView dataSource={this.state.items} renderRow={this.renderItem} //֤ߦͷඳըϝιουΛࢦఆ style={styles.listView}/> ); },
ListView:)ߦͷඳը :"TouchableWithoutFeedback̎ͭҎ্ͷࢠΛԼʹ࣋ͯͳ͍ renderLoadingView: function() { /*লུ*/ }, renderItem: function(item, sectionID,
rowID) { return ( <TouchableWithoutFeedback onPress={() => this.onPressed(item)}> // Πϕϯτݕ <View style={styles.container}> <Image source={{uri: item.user.profile_image_url}} style={styles.thumbnail}/> <View style={styles.rightContainer}> <Text style={styles.title}>{item.title}</Text> <Text style={styles.name}>{item.user.id}</Text> </View> </View> </TouchableWithoutFeedback> ); },
ListView:)APIͷऔಘ window.fetch͕ඪ४Ͱ͑ΔʢCORSͷ੍ͳ͠ʣ fetchData: function() { fetch(QIITA_URL) .then((response) => response.json()) .then((responseData)
=> { this.setState({ items: this.state.items.cloneWithRows(responseData), loaded: true, }); }) .done(); },
ListView:)Πϕϯτͷॲཧ iOSͰͷViewؒͷભҠprops.navigatorͷpush,4popϝιουͳͲ ͕͑Δ //ηϧͷλονΠϕϯτ onPressed: function(item) { this.props.navigator.push({ title: item.title,
component: ReactQiitaItemView, passProps: { url: item.url } }) },
WebView // هࣄӾཡ༻ͷWebView var ReactQiitaItemView = React.createClass({ render: function() {
return ( <WebView url={this.props.url}/> ) } });
ελΠϧͷهड़ // ֤छσβΠϯཁૉɺҰ෦ൈਮ var styles = StyleSheet.create({ navigator: { flex:
1 }, container: { flex: 1, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', backgroundColor: '#FFFFFF', }, }
ىಈ࣌ΤϯτϦϙΠϯτ AppRegistry.registerComponent('ReactQiita', () => ReactQiitaNavigator);
͜Ε·ͰͷNa#ve։ൃͱͷൺֱ • Reac&veʹॻ͘ํ๏RAC͘Β͍͔͠ແ͔ͬͨ • RAC*...*Reac&veCocoa
Reac%veCocoaͱͷൺֱ • ReactNa(veॻ͖ํ͕γϯϓϧ(ޙड़) • Na(veίʔυͱͷϒϦοδΛ࡞͢Δඞཁ͕͋Δ • iOSඪ४ͱൺͯɺσβΠϯཁૉͷهड़ָ͕ • Viewࣗମͷॻ͖ํָͩͱࢥ͏͕͜Ε·ͩϏϡʔ͕খ͍͞ ͔Βͩͱࢥ͏
RACͷॻ͖ํ ͷมߋΛݕ͢Δ͚ͩͰԼهͷΑ͏ͳهड़ɺ [[RACObserve(self, username) filter:^(NSString *newName) { return [newName hasPrefix:@"j"];
}] subscribeNext:^(NSString *newName) { NSLog(@"%@", newName); }];
ReactNa'veͷίί͕ྑ͍ • UIKitϕʔεʹίʔυͰϏϡʔΛهࡌ͢ΔΑΓָ • xibΑΓهड़͕ʢࠓͷͱ͜Ζʣָ • Reac-veͳهड़͕ඇৗʹগͳ͍ίʔυྔͰॻ͚Δ
ReactNa'veͷίί͕μϝ • fetchͳͲ͕ಠ࣮ࣗͬΆ͍ͷͰnpmͷࢿ࢈͕׆͔ͤΔ͔ • ݁ہUIKitͷֶशͷ্ʹReactNa1veͷಠࣗίϯϙʔωϯτͷֶ श͕ඞཁʹͳΔ • na1veͷϒϦοδRCTBridgeModuleʹै͏
࡞ͬͯͷײ • UIKitͱ͍͏͔iOS)SDKΒͳ͍ͱ࡞Εͳ͍ • ͦͷ্ʹReactjsͱReactNa2veͷ͕ࣝඞཁ • ݸਓతʹReac2veͳna2veΞϓϦ͜Ε͕Ұ൪࡞Γ͍͢ͱࢥ ͏ • iOSॻ͚ͯReactjs͔͚ΔਓҎ֎Θͳ͍ํ͕ྑͦ͞͏
• ܶతʹ։ൃΛϥΫʹ͢ΔͷͰͳ͍
࠷ޙʹ • ReactNa(veΫϩεϓϥοτϑΥʔϜͷͨΊͷΈ͡Όͳ͍ ʢͱࢥ͍ͬͯΔʣ • Reac(veͷจ຺Λ࣋ͪࠐΈͯ͘͘͢͠ΕΔSDK • ֤ϓϥοτϑΥʔϜͱReactͷ͕ࣝ͋ΕΑΓΑ͍։ൃ͕Մೳ
ָ͠Α͏ͱࢥ͏ͳΒ (Java|Swi)) ॻ͖·͠ΐ͏