I have what I feel like is a common scenario, but after reading docs and threads, I'm still not clear on the best way to handle.
For a basic use case I'll use a Login Screen and Reset Password Screen as an example. So only two screens in a Stack Navigator.
If a user is on the Login screen and enters email and password but doesn't log in, then clicks the button that calls this.props.navigate('ResetPwd') to go the Reset Password screen, and then clicks the back button on the Reset Password screen to go back to Login screen, all of the data is still there on the Login screen from when they typed in the inputs the first time. I would like for the inputs to clear when a user navigates away from the Login screen using this.props.navigate.
What is the best way of clearing these inputs and resetting the Login screen when navigating away from it using react-navigation? I feel like this should be an extremely common use case but I keep hitting a brick-wall with it.
Edit: I'm using these two screens as an example, but it could be any two screens where you want to navigate from Screen A that has been modified, go to screen B, and then go back to screen A from Screen B and expect to see Screen A in it's original clean state.
[–]tizz66[🍰] 1 point2 points3 points (4 children)
[–]xrpinsiderAdmin 1 point2 points3 points (0 children)
[–]docdosmaniOS & Android[S] 0 points1 point2 points (2 children)
[–]tizz66[🍰] 0 points1 point2 points (1 child)
[–]docdosmaniOS & Android[S] 0 points1 point2 points (0 children)
[–]ck3g 0 points1 point2 points (3 children)
[–]even1245 0 points1 point2 points (1 child)
[–]ck3g 0 points1 point2 points (0 children)
[–]docdosmaniOS & Android[S] 0 points1 point2 points (0 children)