Skip to content

Instantly share code, notes, and snippets.

@sonthonaxrk
Created March 2, 2015 16:34
Show Gist options
  • Save sonthonaxrk/ed3cb3848dd312466664 to your computer and use it in GitHub Desktop.
Save sonthonaxrk/ed3cb3848dd312466664 to your computer and use it in GitHub Desktop.
var ProductSearch = React.createClass({
filterList: function(event){
//debugger;
var updatedProducts = this.state.initialProducts;
updatedProducts = updatedProducts.filter(function(item){
return item.name.toLowerCase().search(event.target.value.toLowerCase()) !== -1;
});
this.setState({filteredProducts: updatedProducts});
},
)};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment