<commit_before>import React, { Component, PropTypes } from 'react';

import Entry from './Entry';
import addMention from '../modifiers/addMention';
import decodeOffsetKey from '../utils/decodeOffsetKey';
import { genKey } from 'draft-js';
import getSearchText from '../utils/getSearchText';
import defaultEntryComponent from './Entry/defaultEntryComponent';

export default class MentionSuggestions extends Component {

  static propTypes = {
    entityMutability: PropTypes.oneOf([
      'SEGMENTED',
      'IMMUTABLE',
      'MUTABLE',
    ]),
    entryComponent: PropTypes.func,
  };

  static defaultProps = {
    entryComponent: defaultEntryComponent,
  };

  state = {
    isActive: false,
    focusedOptionIndex: 0,
  };

  componentWillMount() {
    this.key = genKey();
    this.props.callbacks.onChange = this.onEditorStateChange;
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.suggestions.size === 0 && this.state.isActive) {
      this.closeDropdown();
    }
  }
<commit_msg>add Add propTypes for `mentions` list <commit_after>import React, { Component, PropTypes } from 'react';

import Entry from './Entry';
import addMention from '../modifiers/addMention';
import decodeOffsetKey from '../utils/decodeOffsetKey';
import { genKey } from 'draft-js';
import getSearchText from '../utils/getSearchText';
import defaultEntryComponent from './Entry/defaultEntryComponent';
import { List } from 'immutable';

export default class MentionSuggestions extends Component {

  static propTypes = {
    entityMutability: PropTypes.oneOf([
      'SEGMENTED',
      'IMMUTABLE',
      'MUTABLE',
    ]),
    entryComponent: PropTypes.func,
    suggestions: (props, propName, componentName) => {
      if (!List.isList(props[propName])) {
        return new Error(
          'Invalid prop `' + propName + '` supplied to' +
          ' `' + componentName + '`. should be instance of immutable list.'
        );
      }
    },
  };

  static defaultProps = {
    entryComponent: defaultEntryComponent,
  };

  state = {
    isActive: false,
    focusedOptionIndex: 0,
  };

  componentWillMount() {
    this.key = genKey();
    this.props.callbacks.onChange = this.onEditorStateChange;
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.suggestions.size === 0 && this.state.isActive) {
      this.closeDropdown();
    }
  }

{'fraction_non_alphanumeric': 0.1246278179498086, 'fraction_numerical': 0.0017014036580178648, 'mean_word_length': 3.4293785310734464, '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': '6610401', 'n_tokens_mistral': 701, 'n_tokens_neox': 686, 'n_words': 161}