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
Firebase and React Native
Search
SAWA, Norihiko
July 13, 2016
Technology
770
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Firebase and React Native
SAWA, Norihiko
July 13, 2016
More Decks by SAWA, Norihiko
See All by SAWA, Norihiko
OCR Optimized for Images Created by Print Typesetting
nakamods320yen
0
160
データサイエンスを活用した契約資産価値評価(LTV)とその改善 / Lifetime Value as Asset Pricing with Data Science
nakamods320yen
1
160
日本経済新聞社 デジタル人材採用案内 / Nikkei Digital Hiring
nakamods320yen
1
48k
AI making new content
nakamods320yen
0
8.4k
Dive into E2D3
nakamods320yen
0
500
Other Decks in Technology
See All in Technology
Terraform共通モジュールをチーム横断で“変えられる”運用へ ― リリースと適用の分離
kekke_n
1
2.9k
事業価値を⽣み出すSREへ SREが担うべき意思決定の5層
kenta_hi
2
3.6k
DMM.com 購入改善推進チーム におけるCodeRabbitを用いた レビューフロー改善の一例
ysknsid25
2
620
完全自律ロボットを作りたくて、先に開発を自律させた話(ROS Japan UG #63 LT)
rryz09
0
510
Gen3R: 3D Scene Generation Meets Feed-Forward Reconstruction
spatial_ai_network
0
120
証券システムを10年Scalaで作り続けるということ - 関数型まつり2026
krrrr38
3
840
美しいコードを書くためにF#を学んでみた話
yud0uhu
1
410
環境凍結という Toil を倒す -セルフサービス型 Ephemeral テスト環境の 設計と実践
shirouz
1
2.3k
世界、断片、モデル。そして理解
ardbeg1958
1
110
Devsumi 2026 Summer 人もAIも使える共通基盤を事業の加速装置にする~デザインシステム運用に学ぶ組織レバレッジ~ 渡辺 凌央
legalontechnologies
PRO
0
120
ポストモーテム! DDoSからサイトは守れた。 でもビジネスは守れなかった。
bengo4com
0
2.9k
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
0
140
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.5k
Facilitating Awesome Meetings
lara
57
7k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
GraphQLとの向き合い方2022年版
quramy
50
15k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
290
HDC tutorial
michielstock
2
740
A better future with KSS
kneath
240
18k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
WCS-LA-2024
lcolladotor
0
680
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
610
Transcript
6TJOH'JSFCBTF3FBMUJNF%BUBCBTFCZ3FBDU/BUJWF 4"8" /PSJIJLPຊܦࡁ৽ฉࣾσδλϧฤہ 3FBDU/BUJWFBOE'JSFCBTF
2 4"8" /PSJIJLP %FWFMPQBOE1MBO/JLLFJ0OMJOF %KT3FBDU/BUJWF "CPVUNF
'JSFCBTF3FBMUJNF%BUBCBTF 3
4 #BB4 σʔλߋ৽͕Ϋϥυʹอଘ͞ΕϦΞϧλΠϜͰಉظ Ͱ͖Δ 'JSFCBTF3FBMUJNF%BUBCBTF IUUQTZPVUVCF6BF.EW6Q"
3FBDU/BUJWF 5
6 +BWB4DSJQU &4 ͰJ04"OESPJEΞϓϦ͕ॻ͚Δ 3FBDU/BUJWF IUUQTGBDFCPPLHJUIVCJPSFBDUOBUJWF
7 3FBDU/BUJWF4IPXDBTF IUUQTGBDFCPPLHJUIVCJPSFBDUOBUJWFTIPXDBTFIUNM
-FU`TTUBSU 8
9 'PMMPXJOHUIJT1PTU IUUQTpSFCBTFHPPHMFCMPHDPNUIFCFHJOOFSTHVJEFUPSFBDUOBUJWFBOE@IUNM
10 OQNͰ'JSFCBTFΛΠϯετʔϧ 'JSFCBTFTFUVQ KTϑΝΠϧͰಡΈࠐΈ const Firebase = require('firebase'); npm install
firebase --save
11 %FDMBSF%BUB4PVSDF 1 constructor(props) { 2 super(props); 3 this.state =
{ 4 dataSource: new ListView.DataSource({ 5 rowHasChanged: (row1, row2) => row1 !== row2, 6 }) 7 }; 8 this.itemsRef = new Firebase("<my-fb-app>/items"); 9 }
12 *OJUJBMJ[FMJTUXIFOUIFDPNQPOFOUIBTpSTUCFFOSFOEFSFE 1 listenForItems(itemsRef) { 2 itemsRef.on('value', (snap) => {
3 // get children as an array 4 var items = []; 5 snap.forEach((child) => { 6 items.push({ 7 title: child.val().title, 8 post_time: child.val().post_time, 9 userID: child.val().userID, 10 _key: child.key() 11 }); 12 }); 13 this.setState({ 14 dataSource: this.state.dataSource.cloneWithRows(items) 15 }); 16 }); 17 } 18 19 componentDidMount() { 20 this.listenForItems(this.itemsRef); 21 }
13 DPNQPOFOUT 1 render() { 2 return ( 3 <View
style="{styles.container}"> 4 <ListView 5 dataSource="{this.state.dataSource}" 6 renderRow=“{this._renderItem.bind(this)}" 7 style="{styles.listview}/"> 8 </View> 9 ); 10 }
14 "EE*UFN 1 this.itemsRef.push({ 2 title: this.tmpText, 3 post_time: Firebase.ServerValue.TIMESTAMP,
4 userID: userID 5 });
15 3FNPWF*UFN 1 _renderItem(item) { 2 const onPress = ()
=> { 3 AlertIOS.prompt( 4 'Delete', 5 null, 6 [ 7 {text: 'Delete', onPress: (text) => this.itemsRef.child(item._key).remove()}, 8 {text: 'Cancel', onPress: (text) => console.log('Cancel')} 9 ], 10 'default' 11 ); 12 }; 13 return ( 14 <ListItem item={item} onPress={onPress} /> 15 ); 16 }
$PODMVTJPO 16
17 3FBDU/BUJWFͰͷ'JSFCBTFͷه๏ʹετϨεͳ͍ ʢ·ͩʣ 3FBDUͷTUBUFཧͱɺ'JSFCBTFͷಉظ૬ੑ͕ྑͦ͞͏ $PODMVTJPO “This is where React fits
perfectly with Firebase. Because the Firebase database synchronizes application state across multiple devices, and React efficiently re-renders application state changes.”
18 OBUJWF4%,ΛΠϯετʔϧͯ͠ͳ͍ A4MPX"OJNBUJPOTAϞʔυͩͱ 8FC7JFX͕ݟΕΔ ͓ͦΒ͘+4Ͱಈ͍ͯΔ )PXUPXPSL
IUUQTOJLLFJDPNTBJZP +PJOVT% 19