import React from 'react'; import NewsFeedIndexItem from './news_feed_index_item'; import CreatePostFormContainer from './create_post_form_container'; class NewsFeedIndex extends React.Component { constructor(props){ super(props); } componentDidMount(){ this.props.fetchNewsFeed(); } render() { const posts = this.props.posts.reverse().map(post => { if(post.wall_id === this.props.currentUser.id || this.props.currentUser.friends.includes(post.author_id)){ return ( ); }else{ return null; } }); return (
    {posts}
); } } export default NewsFeedIndex;