Tab navigation state reset when switching back and forth between tabs #250
Unanswered
bencreynolds
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Create a custom |
Beta Was this translation helpful? Give feedback.
2 replies
-
You could set
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In case my title isn't clear, I'll present an example app. It has a bottom tab navigator with two tabs: "Home" and "Account". The Home tab has two screens, the initial screen being a product listing and a second screen for a product. Clicking on a product listing on the first screen navigates the user to the second screen (the product screen). The Account tab has a single screen which just lists the user's account information.
Scenario: The user navigates to a specific product screen from the product listing screen in the Home tab. User then switches tabs to the Account tab and then switches back to the Home tab. When the users switches back to the Home tab, it is back on the product listing screen and not the specific product screen the user was originally on.
I fundamentally understand why this is the case based on how the "href" prop for the tab works, but can this behavior be avoided? This behavior is not default on React Navigation, so certainly it's avoidable. Is there a simple solution to this problem I am not considering?
Beta Was this translation helpful? Give feedback.
All reactions