Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit 5c70add

Browse files
committed
call the fetchPosts function in Posts component
1 parent b41efbe commit 5c70add

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/Posts.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ class Posts extends Component {
77
posts: [],
88
};
99

10+
componentDidMount() {
11+
this.props.fetchPosts();
12+
}
13+
1014
render() {
1115
const postItems = this.state.posts.map((post) => (
1216
<div key={post.id}>

0 commit comments

Comments
 (0)