import * as React from 'react'; import IComment from '../../interfaces/IComment'; interface Props { postId: number; comments: Array; areLoading: boolean; error: string; requestComments(postId: number, page?: number); } class CommentsP extends React.Component { componentDidMount() { this.props.requestComments(this.props.postId); } render() { const { comments, areLoading, error, } = this.props; return (
{comments.map((comment, i) => (
{comment.body}
))}
); } } export default CommentsP;