Initial commit React Weather App

This commit is contained in:
2017-01-13 16:16:04 -08:00
commit 94757c1d78
14 changed files with 268 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
var React = require('react');
var WeatherForm = React.createClass({
onFormSubmit: function (e) {
e.preventDefault();
var location = this.refs.location.value;
if (location.length > 0) {
this.refs.location.value = '';
this.props.onSearch(location);
}
},
render: function () {
return (
<div>
<form onSubmit={this.onFormSubmit}>
<input type="text" ref="location"/>
<button>Get Weather</button>
</form>
</div>
);
}
});
module.exports = WeatherForm;