I have come across a problem where I basically don't really have ideas on how to move on.
I have a StackNavigator with two screens, one is called "HomeScreen", the other one is called "SettingsScreen". When I click on a button, I get to "SettingsScreen".
I also have a DrawerNavigator, with which I can navigate to one of the four screens and Screen 4 is the StackNavigator.
DrawerNavigator:
Screen1
Screen2
Screen3
Screen4
- HomeScreen
- SettingsScreen
(Hopefully it is somehow understandable)
So let's come to the problem...
My problem is that my "SettingsScreen" has the function to add items to an AsyncStorage key (it pushes it to the array so at the end I have a list which I render on my "HomeScreen"), but when I have added the item and return to my "HomeScreen", it won't reload the page. How can I make it so it will reload the page when some condition is met or even simpler - how do I reload the page every time I leave "SettingsScreen"?
It would help to see your code and also to know what version of React Navigation you are using. Most likely you can "push" to the navigation stack which will do a fresh reload of whatever screen you are going to. You would have something like this in your function:
this.props.navigation.push('HomeScreen')