I am using TouchableHighlight, but I can change only background color using underlayColor. But how to change other content?
With TouchableHighlight you can do it like this
state = { selected: false };
setSelected(selected: boolean) {
this.setState({ selected: selected });
}
textStyle() {
return this.state.selected ? styles.textSelected : styles.text;
}
And then in the render function
onPress()}
onShowUnderlay={() => this.setSelected(true)}
onHideUnderlay={() => this.setSelected(false)}
>
{text}