I have 5 buttons [\"running\", \"riding\", \"reading\", \"coding\", \"Niuer\"] in my app and when I click on it, the button changes its color and displays the title on screen. I
The best thing you can do is save your state in Redux and use redux-persist with that. You can also use AsyncStorage. I had similar scenario, I had to maintain state between two component navigating back and forth, I have used navigation params like this:
Screen A:
this.props.navigation.navigate('ScreenB', {
onPressScreenAFun: (params) => {
this.screenAFun(params),
ButtonState1: true // you can send multiple params
},
})
screenAFun = (ButtonState1) => {
this.setState({buttonState1: ButtonState1})
}
Screen B:
screenBFun = (params) => {
const { onPressScreenAFun, ButtonState1 } = this.props.navigation.navigate.state.params
onPressScreenAFun(ButtonState1)
this.props.navigation.goBack()
}