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

Commit 45d5f40

Browse files
committed
add prop types in Posts component
1 parent c80d63e commit 45d5f40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/Posts.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Component } from "react";
2+
import PropTypes from "prop-types";
23
import { connect } from "react-redux";
34
import { fetchPosts } from "../actions/postActions";
45

@@ -23,6 +24,11 @@ class Posts extends Component {
2324
}
2425
}
2526

27+
Posts.protoType = {
28+
fetchPosts: PropTypes.func.isRequired,
29+
posts: PropTypes.array.isRequired,
30+
};
31+
2632
const mapStateToProps = (state) => ({
2733
posts: state.posts.items, // here we used key posts because we used the same key in rootReducer
2834
});

0 commit comments

Comments
 (0)