I have a list of components that I want to render when the user clicks a button. The screen is supposed to be a search screen where the user types in their query, and when they hit the search button a list of results is displayed. However, when I try to make a component render using the onPress, nothing happens. For this example I am just printing text instead of using map to print out components.
renderResults() {
return <Text> Doesn't get printed </Text>
}
render() {
return (
<View>
<Button
onPress={ this.renderResults.bind(this) } //use .bind(this) to access state in renderResults
title="Search!"
color="#841584" />
</View>
);
}