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

class SearchBar extends Component {
	constructor(props) {
		super(props);

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

	render() {
		return (
			<div className="col-md-8 search-bar">
				<h1>Youtube video search</h1>
				Search: <input 
					value={this.state.term} 
					onChange={event => this.setState({ term: event.target.value })} />
			</div>
		);
	}
}

export default SearchBar;<commit_msg>Change the onChange to call a new method onInputChange which sets the state for this component as the value, also calls the callback property onSearchTermChange passing in the value.<commit_after>import React, { Component } from 'react';

class SearchBar extends Component {
	constructor(props) {
		super(props);

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

	render() {
		return (
			<div className="col-md-8 search-bar">
				<h1>Youtube video search</h1>
				Search: <input 
					value={this.state.term} 
					onChange={event => this.onInputChange(event.target.value)} />
			</div>
		);
	}

	onInputChange(term) {
		this.setState({term});
		this.props.onSearchTermChange(term);
	}
}

export default SearchBar;
{'fraction_non_alphanumeric': 0.13823272090988625, 'fraction_numerical': 0.005249343832020997, 'mean_word_length': 3.6504065040650406, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '6247432', 'n_tokens_mistral': 420, 'n_tokens_neox': 368, 'n_words': 92}