<commit_before>import React, {Component} from 'react';
import {connect} from 'react-redux';
import {searchVideos} from '../actions/index';
import {bindActionCreators} from 'redux';


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

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

	handleOnChange(term){
		this.setState({term});
		this.props.searchVideos(term);
		this.props.handleOnChange();
	}

	render(){
		return (
			<div className="search-bar">
				<input 
					value={this.state.term} 
					onChange={ (event) => { this.handleOnChange(event.target.value); }  } />
			</div>
		);
	}

	componentWillMount(){
		this.props.searchVideos(this.state.term);
	}
}

function mapDispatchToProps(dispatch){
	return bindActionCreators({searchVideos: searchVideos}, dispatch);
}

export default connect(null, mapDispatchToProps)(SearchBar);<commit_msg>Reset term state and change default search term.<commit_after>import React, {Component} from 'react';
import {connect} from 'react-redux';
import {searchVideos} from '../actions/index';
import {bindActionCreators} from 'redux';


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

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

	handleOnChange(term){
		this.setState({term});
		this.props.searchVideos(term);
		this.props.handleOnChange();
	}

	render(){
		return (
			<div className="search-bar">
				<input 
					placeholder="Search videos here..."
					value={this.state.term} 
					onChange={ (event) => { this.handleOnChange(event.target.value); }  } />
			</div>
		);
	}

	componentWillMount(){
		this.props.searchVideos('Dota 2');
	}
}

function mapDispatchToProps(dispatch){
	return bindActionCreators({searchVideos: searchVideos}, dispatch);
}

export default connect(null, mapDispatchToProps)(SearchBar);
{'fraction_non_alphanumeric': 0.1531127313516545, 'fraction_numerical': 0.0005608524957936063, 'mean_word_length': 4.773462783171521, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '6172379', 'n_tokens_mistral': 639, 'n_tokens_neox': 568, 'n_words': 113}