<commit_before>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { select } from '../actions/mentionActions';
import DefaultList from '../components/DefaultList.js';

@connect(state => ({
  editor: state.mention.editor,
  highlightIndex: state.mention.highlightIndex,
  matchedSources: state.mention.matchedSources
}))
export default class SuggestionRenderer {

  static propTypes = {
    highlightIndex: PropTypes.number.isRequired,
    matchedSources: PropTypes.array.isRequired,
    customListRenderer: PropTypes.func
  }

  _renderCustomComponents() {
    const {
      customListRenderer,
      highlightIndex,
      matchedSources,
      dispatch
    } = this.props;

    const onClick = (index) => dispatch(select(index));

    return customListRenderer({
      highlightIndex,
      matchedSources,
      clickFn: onClick
    });
  }

  render() {
    const { customListRenderer } = this.props;

    return (
      customListRenderer instanceof Function
        ? this._renderCustomComponents()
        : <DefaultList />
    );
  }
}
<commit_msg>Returned fetching prop from customRenderer<commit_after>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { select } from '../actions/mentionActions';
import DefaultList from '../components/DefaultList.js';

@connect(state => ({
  editor: state.mention.editor,
  fetching: state.mention.fetching,
  highlightIndex: state.mention.highlightIndex,
  matchedSources: state.mention.matchedSources
}))
export default class SuggestionRenderer {

  static propTypes = {
    highlightIndex: PropTypes.number.isRequired,
    matchedSources: PropTypes.array.isRequired,
    customListRenderer: PropTypes.func
  }

  _renderCustomComponents() {
    const {
      customListRenderer,
      fetching,
      highlightIndex,
      matchedSources,
      dispatch
    } = this.props;

    const onClick = (index) => dispatch(select(index));

    return customListRenderer({
      fetching,
      highlightIndex,
      matchedSources,
      clickFn: onClick
    });
  }

  render() {
    const { customListRenderer } = this.props;

    return (
      customListRenderer instanceof Function
        ? this._renderCustomComponents()
        : <DefaultList />
    );
  }
}

{'fraction_non_alphanumeric': 0.1052170100832968, 'fraction_numerical': 0.0, 'mean_word_length': 3.297551789077213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1075106', 'n_tokens_mistral': 627, 'n_tokens_neox': 620, 'n_words': 134}