<commit_before>import React, {Component, PropTypes} from 'react';
import FormField from './FormField';
import classNames from 'classnames';
import Utils from '../../../utils';

class MultiInput extends Component {

  static propTypes = {
    className: PropTypes.string,
    value: PropTypes.arrayOf(React.PropTypes.string).isRequired,
    onChange: PropTypes.func.isRequired, // Function of signature (newValue) => ()
    placeholder: PropTypes.string
  };

  change(key, value) {
    const valueClone = this.props.value.slice();
    if (key === -1) {
      valueClone.push(value);
    } else {
      valueClone[key] = value;
    }
    this.props.onChange(_.without(valueClone, ""));
  };

  render() {
    const valueClone = this.props.value.slice()
    if (!valueClone.length || _.last(valueClone)) {
      valueClone.push("")
    }
    return (
      <div id={this.props.id} className={this.props.className}>
        {
          valueClone.map((value, key) => {
            return (
              <FormField
                key = {key}
                prop = {{
                  value: value,
                  updateFn: event => this.change(key, event.target.value),
                  /* required: this.props.required, Can't mark this as form required because there will always be an extra empty field */
                  type: "text",
                  placeholder: this.props.placeholder
                }}
              />
            );
          })
        }
      </div>
    );
  };
}

export default MultiInput;
<commit_msg>Don't have commented out code<commit_after>import React, {Component, PropTypes} from 'react';
import FormField from './FormField';
import classNames from 'classnames';
import Utils from '../../../utils';

class MultiInput extends Component {

  static propTypes = {
    className: PropTypes.string,
    value: PropTypes.arrayOf(React.PropTypes.string).isRequired,
    onChange: PropTypes.func.isRequired, // Function of signature (newValue) => ()
    placeholder: PropTypes.string
  };

  change(key, value) {
    const valueClone = this.props.value.slice();
    if (key === -1) {
      valueClone.push(value);
    } else {
      valueClone[key] = value;
    }
    this.props.onChange(_.without(valueClone, ""));
  };

  render() {
    const valueClone = this.props.value.slice()
    if (!valueClone.length || _.last(valueClone)) {
      valueClone.push("")
    }
    return (
      <div id={this.props.id} className={this.props.className}>
        {
          valueClone.map((value, key) => {
            return (
              <FormField
                key = {key}
                prop = {{
                  value: value,
                  updateFn: event => this.change(key, event.target.value),
                  type: "text",
                  placeholder: this.props.placeholder
                }}
              />
            );
          })
        }
      </div>
    );
  };
}

export default MultiInput;

{'fraction_non_alphanumeric': 0.13473256601218686, 'fraction_numerical': 0.0006770480704129993, 'mean_word_length': 1.9432270916334662, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '5105507', 'n_tokens_mistral': 825, 'n_tokens_neox': 835, 'n_words': 185}