<commit_before>import { PureComponent, createElement } from 'react';
import { withRouter } from 'react-router';
import PropTypes from 'prop-types';

import { getRouteLinks } from './emission-pathways-table-selectors';
import EmissionPathwaysTableComponent from './emission-pathways-table-component';

class EmissionPathwaysTableContainer extends PureComponent {
  render() {
    const routeData = {
      routes: this.props.routes,
      hash: location && location.hash
    };

    return createElement(
      EmissionPathwaysTableComponent,
      Object.assign(
        {
          ...this.props
        },
        { anchorLinks: getRouteLinks(routeData) }
      )
    );
  }
}

EmissionPathwaysTableContainer.propTypes = {
  routes: PropTypes.array
};

export default withRouter(EmissionPathwaysTableContainer);<commit_msg>Always use map state to props when using a selector<commit_after>import { withRouter } from 'react-router';
import { connect } from 'react-redux';
import { getRouteLinks } from './emission-pathways-table-selectors';
import Component from './emission-pathways-table-component';

const mapStateToProps = (state, { location, routes }) => {
  const routeData = {
    routes,
    hash: location && location.hash
  };

  return {
    anchorLinks: getRouteLinks(routeData)
  };
};

export default withRouter(connect(mapStateToProps, null)(Component));
{'fraction_non_alphanumeric': 0.1110299488677867, 'fraction_numerical': 0.0, 'mean_word_length': 3.9280575539568345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3959859', 'n_tokens_mistral': 384, 'n_tokens_neox': 380, 'n_words': 88}