import React from 'react';
import { connect } from 'react-redux';
class CommentsList extends React.Component {
render(){
return
{this.props.comments.map((comment, index) =>
- {comment}
)}
}
}
const mapStateToProps = function(state){
return {
comments: state
}
}
const VisibleCommentsList = connect(
mapStateToProps
)(CommentsList);
export default VisibleCommentsList;