質問編集履歴
2
itemの初期値を空文字列に変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
constructor(props) {
|
20
20
|
super(props);
|
21
21
|
this.state = {
|
22
|
-
item
|
22
|
+
item: ''
|
23
23
|
};
|
24
24
|
}
|
25
25
|
async componentDidMount() {
|
@@ -27,14 +27,14 @@
|
|
27
27
|
const db = getFirestore();
|
28
28
|
const docRef = doc(db, "", "");
|
29
29
|
var docSnap = await getDoc(docRef);
|
30
|
-
this.setState({item
|
30
|
+
this.setState({item:docSnap.data()['0'][0]})
|
31
31
|
}
|
32
32
|
render() {
|
33
|
-
const item
|
33
|
+
const item = this.state.item;
|
34
34
|
return (
|
35
35
|
<div>
|
36
|
-
<p>{item
|
36
|
+
<p>{item}</p>
|
37
|
-
<TwitterTweetEmbed tweetId={{item
|
37
|
+
<TwitterTweetEmbed tweetId={{item}} options={{width:550}} />
|
38
38
|
</div>
|
39
39
|
);
|
40
40
|
};
|
1
該当のコンポーネントのID指定部分の文法がリファレンスと異なっていたため修正しました。挙動に変化はありませんでした。
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
return (
|
35
35
|
<div>
|
36
36
|
<p>{items}</p>
|
37
|
-
<TwitterTweetEmbed tweetId={items} options={{width:550}} />
|
37
|
+
<TwitterTweetEmbed tweetId={{items}} options={{width:550}} />
|
38
38
|
</div>
|
39
39
|
);
|
40
40
|
};
|