質問編集履歴
1
試したことを追記しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -108,4 +108,23 @@
|
|
108
108
|
</Provider>
|
109
109
|
);
|
110
110
|
}
|
111
|
+
```
|
112
|
+
|
113
|
+
## 追記
|
114
|
+
|
115
|
+
async dispatchにしてみましたがやはりできませんでした。
|
116
|
+
|
117
|
+
```JavaScript
|
118
|
+
export const fetchPosts = () => async dispatch => {
|
119
|
+
postsRef.get().then(querySnapshot => {
|
120
|
+
querySnapshot
|
121
|
+
.forEach(function(doc) {
|
122
|
+
const posts = doc.data();
|
123
|
+
return posts;
|
124
|
+
})
|
125
|
+
.then(posts => {
|
126
|
+
dispatch({ type: "FETCH_POSTS", payload: posts });
|
127
|
+
});
|
128
|
+
});
|
129
|
+
};
|
111
130
|
```
|