Created
July 15, 2015 12:07
-
-
Save hedgerworkco/bb69d2d92ea2f7e64355 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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