I have a button, that change textValue of a text object, but I also have to change object's style
this.state = {
login_title: 'Initial Value',
isButtonPressed: true,
};
this.onPressButton= this.onPressButton.bind(this);
}
onPressButton() {
this.setState({
isButtonPressed : !this.state.isButtonPressed,
login_title : (this.state.isButtonPressed) ? 'Second Value' : 'Intial Value',
})
}
...
<Button onPress= {this.onPressButton}>
<ButtonText>Change Value</ButtonText>
<Text>{this.state.textValue}</Text>