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.4k
Dive into E2D3
nakamods320yen
0
500
Other Decks in Technology
See All in Technology
脱SaaS!FDEを支えるプロビジョニングと分離設計
knih
0
240
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
150
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
300
入門!AWS Blocks
ysuzuki
1
160
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
220
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
230
Agile and AI Redmine Japan 2026
hiranabe
3
290
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
280
AI時代のコスト管理を考えよう〜明日から使える実践AWSノウハウ~
yoshimi0227
0
310
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
1.3k
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
3
570
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
320
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
800
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
390
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
220
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
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