<commit_before>import React from 'react'
import { connect } from 'react-redux'
import { addUser } from '../../actions'

let AddUser = ({ dispatch }) => {
  let input = '';

  return (<div className="InputArea">
    <input type="text" autoFocus placeholder="e.g. <NAME>" ref={node => { input = node; }}></input>
    <button onClick={() => {
      dispatch(addUser(input.value));
      input.value = '';
      input.focus();
    }}>Go!</button>
  </div>)
};

AddUser = connect()(AddUser);

export default AddUser;<commit_msg>use mapDispatchToProps to make addUser a 'dumb' component internally<commit_after>import React from 'react'
import { connect } from 'react-redux'
import { addUser } from '../../actions'

let AddUser = ({ handleClick }) => {
  let input = '';
  return (<div className="InputArea">
    <input type="text" autoFocus placeholder="e.g. <NAME>" ref={node => { input = node; }}></input>
    <button onClick={() => {
      handleClick(input.value);
      input.value = '';
      input.focus();
    }}>Go!</button>
  </div>)
};

const mapDispatchToProps = (dispatch) => ({
  handleClick: (value) => {
    dispatch(addUser(value))
  }
})

AddUser = connect(undefined, mapDispatchToProps)(AddUser);

export default AddUser;
{'fraction_non_alphanumeric': 0.18704453441295546, 'fraction_numerical': 0.0, 'mean_word_length': 3.735632183908046, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, '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': '7640440', 'n_tokens_mistral': 384, 'n_tokens_neox': 382, 'n_words': 96}