<commit_before>import React from 'react';

class PostsShow extends React.Component {
  render() {
    return (
      <div>
        Posts Show
      </div>
    )
  };
}

export default PostsShow;
<commit_msg>Get single post in component<commit_after>import React from 'react';
import connect from 'react-redux';
import { fetchPost } from '../actions';

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

  render() {
    return (
      <div>
        Posts Show
      </div>
    )
  }
}

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

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

{'fraction_non_alphanumeric': 0.12719891745602166, 'fraction_numerical': 0.0, 'mean_word_length': 2.978494623655914, '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': '1527222', 'n_tokens_mistral': 237, 'n_tokens_neox': 229, 'n_words': 60}