<commit_before>import React, {Component} from 'react';
import { connect } from 'react-redux'
import { createStore } from 'redux';
// style
import '../assets/styles/NewItem.css';
// config
import * as TaskActions from '../actions/TaskActions';

class NewItem extends Component {
  constructor(props) {
    super(props);
  }

  add(e, text) {
    if (e.keyCode == 13) {
      this.props.createTask({
        text: text,
        completed: false
      });
    }
  }

  render() {
    let taskInput;

    return (
      <div className="new-item">
        <input
          type="text"
          placeholder="New task"
          onKeyDown={e => this.add(e, taskInput.value)}
          ref={node => taskInput = node}
        />
      </div><commit_msg>reading task value from e.target and reseting input after<commit_after>import React, {Component} from 'react';
import { connect } from 'react-redux'
import * as TaskActions from '../actions/TaskActions';
// style
import '../assets/styles/NewItem.css';

class NewItem extends Component {
  constructor(props) {
    super(props);
  }

  create(e) {
    if (e.keyCode == 13) {
      this.props.createTask({
        text: e.target.value,
        completed: false
      });

      e.target.value = '';
    }
  }

  render() {
    return (
      <div className="new-item">
        <input
          type="text"
          placeholder="New task"
          onKeyDown={e => this.create(e)}
        />
      </div>
{'fraction_non_alphanumeric': 0.14512785072563925, 'fraction_numerical': 0.0027643400138217, 'mean_word_length': 2.2393736017897092, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, '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': '6312498', 'n_tokens_mistral': 449, 'n_tokens_neox': 437, 'n_words': 106}