<commit_before>import React from 'react'

import { connect } from 'react-redux'

class Message extends React.Component {
  render() {
    return (
      <div>
        {this.props.author}: {this.props.message}
      </div>
    )
  }
}

class MessageList extends React.Component {
  render() {
    return (
      <div>
        {this.props.messages.map(
          msg => <Message key={msg.id}
                          author={msg.author} message={msg.message} />
        )}
      </div>
    )
  }
}

const VisibleMessageList = connect(
  (state) => {
    return {
      messages: state.messages
    }
  }
)(MessageList)

class Input extends React.Component {

  constructor(props) {
      super(props);
      this.state = {
        value: ""
      }
  }

  render() {
    return (
      <input type="text" value={this.state.value}
             onChange={this.handleChange} />
    )
  }
}

export class App extends React.Component {
  render() {
    return (
      <div>
        <Input/>
        <VisibleMessageList />
      </div>
    )
  }
}<commit_msg>Make OneLineInput form capable of hanlding submit events<commit_after>import React from 'react'

import { connect } from 'react-redux'

class Message extends React.Component {
  render() {
    return (
      <div>
        {this.props.author}: {this.props.message}
      </div>
    )
  }
}

class MessageList extends React.Component {
  render() {
    return (
      <div>
        {this.props.messages.map(
          msg => <Message key={msg.id}
                          author={msg.author} message={msg.message} />
        )}
      </div>
    )
  }
}

const VisibleMessageList = connect(
  (state) => {
    return {
      messages: state.messages
    }
  }
)(MessageList)

class OneLineInputForm extends React.Component {

  constructor(props) {
      super(props);
      this.state = {
        value: ""
      }
  }

  render() {
    return (
      <form onSubmit={this.handleSubmit.bind(this)} >
        <input type="text" value={this.state.value}
               onChange={this.handleChange.bind(this)} />
      </form>
    )
  }

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

  handleSubmit(event) {
    if (this.props.onSubmit != null) {
      this.props.onSubmit(this.state.value);
    }

    this.setState({value: ""});
    event.preventDefault();
  }
}

export class App extends React.Component {
  render() {
    return (
      <div>
        <OneLineInputForm />
        <VisibleMessageList />
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.13864541832669322, 'fraction_numerical': 0.0, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 29, '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': '2237263', 'n_tokens_mistral': 795, 'n_tokens_neox': 789, 'n_words': 150}