<commit_before>import React, { Component } from 'react';
import { fetchPost } from '../actions/postsActionCreator';

class PostsShow extends Component {
  render() {
    return <div>Post!</div>;
  }
}

export default PostsShow;
<commit_msg>complete selecting from own props, add post prop to postsShow<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { fetchPost } from '../actions/postsActionCreator';

class PostsShow extends Component {
  componentDidMount() {
    const { id } = this.props.match.params;
    this.props.fetchPost(id);
  }

  render() {
    return <div>Post!</div>;
  }
}

function mapStateToProps({ posts }, ownProps) {
  return { post: posts[ownProps.match.params.id] };
}

export default connect(mapStateToProps, { fetchPost })(PostsShow);

{'fraction_non_alphanumeric': 0.13513513513513514, 'fraction_numerical': 0.0, 'mean_word_length': 4.433333333333334, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3282165', 'n_tokens_mistral': 251, 'n_tokens_neox': 245, 'n_words': 65}