質問編集履歴
4
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -82,6 +82,7 @@
|
|
82
82
|
|
83
83
|
fetchData() {
|
84
84
|
のところのコードがおかしいと思うのですが、原因がわかっていません。
|
85
|
+
|
85
86
|
---
|
86
87
|
###補足
|
87
88
|
itemsのドキュメントにはphraseとurlというフィールドがあります。
|
3
詳細な情報の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -77,9 +77,11 @@
|
|
77
77
|
```
|
78
78
|
###現在出ているエラー
|
79
79
|
ページを引っ張って更新しようとすると
|
80
|
-
|
80
|
+
TypeError:undefined is not an object(evaluating 'this.fetchData().then')
|
81
81
|
と出ます。
|
82
82
|
|
83
|
+
fetchData() {
|
84
|
+
のところのコードがおかしいと思うのですが、原因がわかっていません。
|
83
85
|
---
|
84
86
|
###補足
|
85
87
|
itemsのドキュメントにはphraseとurlというフィールドがあります。
|
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,22 +14,22 @@
|
|
14
14
|
}
|
15
15
|
|
16
16
|
fetchData() {
|
17
|
-
|
17
|
+
const items = [];
|
18
|
+
Fire
|
18
19
|
.shared
|
19
20
|
.itemsCollection
|
20
21
|
.get()
|
21
|
-
|
22
|
-
|
22
|
+
.then(function(querySnapshot) {
|
23
|
-
|
23
|
+
querySnapshot.forEach(function(doc) {
|
24
|
-
|
24
|
+
items.push(doc.data());
|
25
|
-
|
25
|
+
});
|
26
|
-
|
27
|
-
|
26
|
+
this.setState({ items: items });
|
27
|
+
});
|
28
28
|
}
|
29
29
|
|
30
30
|
_onRefresh() {
|
31
31
|
this.setState({refreshing: true});
|
32
|
-
fetchData().then(() => {
|
32
|
+
this.fetchData().then(() => {
|
33
33
|
this.setState({refreshing: false});
|
34
34
|
});
|
35
35
|
}
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -52,7 +52,6 @@
|
|
52
52
|
const items = this.state.items;
|
53
53
|
return (
|
54
54
|
<Container>
|
55
|
-
|
56
55
|
<Content style={styles.cnt} refreshControl={
|
57
56
|
<RefreshControl
|
58
57
|
refreshing={this.state.refreshing}
|