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

export default class AddTask extends Component {
  constructor(props) {
    super(props);

    this.addTask = this.addTask.bind(this);
    this.handleChange = this.handleChange.bind(this);

    this.state = {
      taskText: ''
    };
  };

  handleChange(event) {
    this.setState({ taskText: event.target.value });
  };

  addTask(event) {
    event.preventDefault();

    var tasks = this.props.tasks;
    tasks.push(this.state.taskText);
    this.props.updateCategory(this.props.categoryName, tasks);

    this.setState({ taskText: '' });
  };

  render() {
    return (
      <div className='add-task'>
        <form onSubmit={this.addTask}>
          <input 
            type='text' 
            value={this.state.taskText}
            onChange={this.handleChange}
            placeholder='What do you need to get done?' 
          />
        <button type='submit' id='add-task' > + </button>
        </form>
      </div>
    );
  };
}<commit_msg>rid of form element and use arrow functions<commit_after>import React, { Component } from 'react';

export default class AddTask extends Component {
  state = { taskText: '' };

  handleChange = ( event ) => {
    this.setState({ taskText: event.target.value });
  };

  addTask = () => {
    var tasks = this.props.tasks;
    tasks.push(this.state.taskText);
    this.props.updateCategory(this.props.categoryName, tasks);

    this.setState({ taskText: '' });
  };

  inputKey = ( e ) => {
    if( e.keyCode === 13 ) {
      this.addTask();
    }
  };

  render() {
    return (
      <div className='category-add-task'>
        <input 
          type='text' 
          value={this.state.taskText}
          onChange={this.handleChange}
          onKeyDown={this.inputKey}
          placeholder='What do you need to get done?' 
        />
        <button id='add-task' onClick={this.addTask} > + </button>
      </div>
    );
  };
}
{'fraction_non_alphanumeric': 0.15115681233933162, 'fraction_numerical': 0.0010282776349614395, 'mean_word_length': 2.3321917808219177, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 18, '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': '3003230', 'n_tokens_mistral': 606, 'n_tokens_neox': 591, 'n_words': 117}