Skip to content

Instantly share code, notes, and snippets.

@hedgerworkco
Created July 15, 2015 12:07
Show Gist options
  • Save hedgerworkco/bb69d2d92ea2f7e64355 to your computer and use it in GitHub Desktop.
Save hedgerworkco/bb69d2d92ea2f7e64355 to your computer and use it in GitHub Desktop.
var Parent = React.createClass({
onInputChange(e) {
this.setState({
input: e.target.value
});
},
filterCities(cities, input) {
return cities.filter(city => {
// ...
});
},
render() {
return (
<div>
<SearchFilter
onInputChange={ this.onInputChange } />
<CityList
cities={ this.filterCities(this.state.cities, this.state.input) }>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment