I found this code in the react-native-dynamic-search-bar, and I couldn't find a way to make it with react-native-hooks.
this.setState({
query: text,
dataSource: newData,
});
And this is the whole function
const filterProjectList = (text) => {
var newData = dataBackup.filter((item) => {
const itemData = item.name.toLowerCase();
const textData = text.toLowerCase();
return itemData.indexOf(textData) > -1;
});
this.setState({
query: text,
dataSource: newData,
});
};