<commit_before>var Greeter = React.createClass({
	getDefaultProps: function() {
		return {
			name: 'React',
			message: 'This is the default message'
		}
	},

	getInitialState: function () {
		return {
			name: this.props.name
		};
	},

	onButtonClick: function (e) {
		e.preventDefault();

		var nameRef = this.refs.name;

		var name = nameRef.value;
		nameRef.value = "";

		if (typeof name === 'string' && name.length >0) {
		this.setState({
			name: name
		});

		}

	},

	render: function () {
		var name = this.state.name;
		var message = this.props.message;
		return (
			<div>
		      <h1>Hello {name}</h1>
		      <p>{message + "!!!!"}</p>

		      <form onSubmit={this.onButtonClick}>
		      	<input type="text" ref="name"/>
		      	<button>Set Name</button>
		      </form>
			</div>
		);
	}
});

var firstName ="Lee";

ReactDOM.render(
	<Greeter name={firstName}/>,
  document.getElementById('app')
  );<commit_msg>pass name change prop<commit_after>var GreeterMessage = React.createClass({
	render: function () {
		return (
			<div>
				<h1>something h1</h1>
				<p>ptag</p>
			</div>)
	}
});

var GreeterForm = React.createClass({
	onFormSubmit: function (e) {
		e.preventDefault();

		var name = this.refs.name.value;

		if (name.length > 0) {
			this.refs.name.value = "";
			this.props.onNewName(name);
		}
	},
	render: function () {
		return (
			<form>
		      	<input type="text" ref="name"/>
		      	<button>Set Name</button>
		   </form>
			)
	}
});

var Greeter = React.createClass({
	getDefaultProps: function() {
		return {
			name: 'React',
			message: 'This is the default message'
		}
	},

	getInitialState: function () {
		return {
			name: this.props.name
		};
	},

	handleNewName: function (name) {
		this.setState({
			name: name
		});

	},

	render: function () {
		var name = this.state.name;
		var message = this.props.message;
		return (
			<div>
		      <h1>Hello {name}</h1>
		      <p>{message + "!!!!"}</p>

		      <GreeterMessage/>
		      <GreeterForm onNewName={this.handleNewName}/>
			</div>
		);
	}
});

var firstName ="Lee";

ReactDOM.render(
	<Greeter name={firstName}/>,
  document.getElementById('app')
  );
{'fraction_non_alphanumeric': 0.17622571692876965, 'fraction_numerical': 0.004162812210915819, 'mean_word_length': 2.7552083333333335, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 37, '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': '3426175', 'n_tokens_mistral': 895, 'n_tokens_neox': 782, 'n_words': 158}