componentDidMount() {
    if (!this.props.post) {
      // provided by react router as param `id`
      const { id } = this.props.match.params;
      this.props.fetchPost(id);

    }
  }
// if post has not been fetched, get it
if post has not been fetched, get it
if post has not been fetched get it
componentDidMount() {
    if (!this.props.post) {
      const { id } = this.props.match.params;
      this.props.fetchPost(id);
    }
  }
componentDidMount ( ) { if ( ! this . props . post ) { const { id } = this . props . match . params ; this . props . fetchPost ( id ) ; } }
if post has not been fetched, get it
if post has not been fetched get it
// provided by react router as param `id`