<commit_before>import React from 'react'
import { connect } from 'react-redux'
import { addTeam } from './actionCreators'

const AddTeam = React.createClass({
  getInitialState: function() {
    return {
      value: ''
    }
  },

  char: function(e) {
    this.setState({value: e.target.value})
  },

  add: function() {
    this.props.dispatch(addTeam(this.state.value))
    this.setState({value: ''})
  },

  render: function() {
    return (
      <div>
        <input type='text' value={this.state.value} onChange={this.char} />
        <button onClick={this.add}> Add </button>
      </div>
    )
  }
})

export default connect()(AddTeam)

<commit_msg>Avoid a call to dispatch<commit_after>import React from 'react'
import { connect } from 'react-redux'
import { addTeam } from './actionCreators'

const AddTeam = React.createClass({
  getInitialState: function() {
    return {
      value: ''
    }
  },

  char: function(e) {
    this.setState({value: e.target.value})
  },

  add: function() {
    this.props.addTeam(this.state.value)
    this.setState({value: ''})
  },

  render: function() {
    return (
      <div>
        <input type='text' value={this.state.value} onChange={this.char} />
        <button onClick={this.add}> Add </button>
      </div>
    )
  }
})

export default connect(null, { addTeam })(AddTeam)


{'fraction_non_alphanumeric': 0.16392215568862276, 'fraction_numerical': 0.0, 'mean_word_length': 2.909356725146199, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2855170', 'n_tokens_mistral': 444, 'n_tokens_neox': 442, 'n_words': 92}