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
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.3k
Dive into E2D3
nakamods320yen
0
490
Other Decks in Technology
See All in Technology
Agentic Web
dynamis
1
180
SIer20年! 培ったスキルがスタートアップで輝く時
shucho0103
0
770
protovalidate-es を導入してみた
bengo4com
0
160
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
2
410
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
2
250
Claude Code の Sandbox 機能を Anthropic Sandbox Runtime(srt) で試そう!/lets-play-anthropic-sandbox-runtime
tomoki10
1
190
Dario Amodi『Policy on the AI Exponential』を理解する
nagatsu
0
200
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
210
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
370
いまさら聞けない人のためのAIコーディング入門
devops_vtj
0
130
OCI Oracle AI Database Services新機能アップデート(2026/03-2026/05)
oracle4engineer
PRO
0
300
ABEMA の Datadog × OTel 基盤、 中から見るか? 外から見るか?
tetsuya28
0
110
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
220
Un-Boring Meetings
codingconduct
0
310
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Tell your own story through comics
letsgokoyo
1
950
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
720
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
220
YesSQL, Process and Tooling at Scale
rocio
174
15k
Bash Introduction
62gerente
615
210k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
600
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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