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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
150
データサイエンスを活用した契約資産価値評価(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
Why is RC4 still being used?
tamaiyutaro
0
260
AI Agentをシステムに組み込む前にゆるく向き合ってみる
hayama17
0
180
感情と身体を置き去りにしない、エンジニアの生きのこり方 ──いまから、ここから「自分の状態」を扱うという選択
saorimurooka
0
430
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
210
水を運ぶ人としてのリーダーシップ
izumii19
4
1.1k
GitHub Copilot運用のリアル ~AI Credit時代にどう向き合うか~
takafumisu2uk1
0
580
Docker Desktop不要の時代が来る? WSL標準の「wslc」で Linuxコンテナを動かしてみた.
ueponx
0
380
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.7k
AI・ロボティクスと自動化社会 / AI, Robotics, and the Automated Society
ks91
PRO
0
120
Terraform 101 (初心者向け) 資料
shuadachi
0
140
そこにあるから地図ができる~位置を示す"モノ"を愉しむ~ - Interface 2026年6月号GPS特集オフ会 / interface_202606_GPS_offline
sakaik
1
160
product engineering with qa
nealle
0
130
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
A Modern Web Designer's Workflow
chriscoyier
698
190k
Facilitating Awesome Meetings
lara
57
7k
Designing for humans not robots
tammielis
254
26k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
600
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Designing Experiences People Love
moore
143
24k
Color Theory Basics | Prateek | Gurzu
gurzu
0
380
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
860
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Raft: Consensus for Rubyists
vanstee
141
7.6k
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