<commit_before>import { Component, h } from 'preact';
import TodoItem from './todo-item';

interface TodoListState {
  todos: { text: string }[];
  text: string;
}

export default class TodoList extends Component<{}, TodoListState> {
  state = { todos: [], text: '' };

  setText = (e: Event) => {
    this.setState({
      text: (e.target as HTMLInputElement).value
    } as TodoListState);
  }

  addTodo = () => {
    const { todos, text } = this.state;

    this.setState({
      todos: [...todos, { text }],
      text: ''
    });
  }

  render({}, { todos, text }) {
    return (
      <form onSubmit={this.addTodo} action="javascript:">
        <input value={text} onInput={this.setText} />
        <button type="submit">Add</button>
        <ul>{todos.map(todo => <TodoItem text={todo.text} />)}</ul>
      </form>
    );
  }
}<commit_msg>Removed unnecessary type assertion.<commit_after>import { Component, h } from 'preact';
import TodoItem from './todo-item';

interface TodoListState {
  todos: { text: string }[];
  text: string;
}

export default class TodoList extends Component<{}, TodoListState> {
  state = { todos: [], text: '' };

  setText = (e: Event) => {
    this.setState({
      text: (e.target as HTMLInputElement).value
    });
  }

  addTodo = () => {
    const { todos, text } = this.state;

    this.setState({
      todos: [...todos, { text }],
      text: ''
    });
  }

  render({}, { todos, text }) {
    return (
      <form onSubmit={this.addTodo} action="javascript:">
        <input value={text} onInput={this.setText} />
        <button type="submit">Add</button>
        <ul>{todos.map(todo => <TodoItem text={todo.text} />)}</ul>
      </form>
    );
  }
}
{'fraction_non_alphanumeric': 0.18658034137728075, 'fraction_numerical': 0.0, 'mean_word_length': 2.7362637362637363, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 27, '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': '95880', 'n_tokens_mistral': 582, 'n_tokens_neox': 585, 'n_words': 127}