import React from 'react'; import ReactMarkdown from 'react-markdown'; import { connect } from 'react-redux'; import { fetchUserProfile } from '../actions'; import { Link } from 'react-router-dom'; class User extends React.Component { constructor (props) { super(props) this.state = { isLoading: true } } componentDidMount() { const { user } = this.props.match.params this.props.fetchUserProfile(user) .then(() => this.setState({isLoading: false})) } renderList() { const posts = this.props.user.currentUser.posts return posts.map(post => { return (
Loading
} else { const currentUser = user.currentUser return (