Instantly share code, notes, and snippets.

Embed
What would you like to do?
filterSearch(text){
this.setState({text})
let newData = this.dataFilter(text, this.state.rawData);
this.setState({
dataSource: this.state.dataSource.cloneWithRows(newData),
isLoaded: true,
empty: false
})
}
dataFilter(text, data){
return data.filter(function(item){
const itemData = item.name.toUpperCase()
const textData = text.toUpperCase()
return itemData.indexOf(textData) > -1
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment