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.3k
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
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
260
Oxcを導入して開発体験が向上した話
yug1224
4
320
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
360
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
550
3Dシーンの圧縮
fadis
1
770
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
650
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
690
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
110
Vite+ Unified Toolchain for the Web
naokihaba
0
320
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
810
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.7k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
160
The untapped power of vector embeddings
frankvandijk
2
1.8k
Embracing the Ebb and Flow
colly
88
5.1k
Technical Leadership for Architectural Decision Making
baasie
3
410
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
Prompt Engineering for Job Search
mfonobong
0
350
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
390
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)) ॻ͖·͠ΐ͏