// @flow import * as React from 'react'; type CommentListProps = { comments: {}, fetchList: string => void, uri: string, isLoading: boolean, }; type CommentProps = { commentId: string, claimId: string, author: string, message: string, timePosted: number, }; class CommentList extends React.PureComponent { componentDidMount() { this.fetchComments(this.props); } fetchComments = (props: Props) => { const { fetchList, uri } = props; fetchList(uri); }; render() { const { comments } = this.props; if (!comments) { return null; } return (
); } } class Comment extends React.PureComponent { render() { return (
Author: {this.props.author}
Date: {this.props.timePosted}
Message: {this.props.message}
); } } export default CommentList;