-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for passing params on navigate to tabs #969
Conversation
Can you describe the API changes a bit more? For example, what was the behaviour earlier and what is the behaviour now. I'm assuming it allows passing params to another tab in the same tab router with Unlike stack navigator, screens in tab navigator are not rendered when you navigate to them, they are rendered in advance when the tab navigator gets rendered. Also you can navigate to other screens by swipe, or pressing the icon/label on the tab bar, and you cannot pass params this way. So the params need to be available when all the screens render. You should be able to do To change the params after rendering, as you might need sometimes, you should be able to use |
Hi @satya164, let me go through your questions one by one:
Sure:
This can easily be fixed by adding an onNavigate handler to the route definition so you could receive a navigation event, that would let you do the following that currently none of this is supported
I find it crucial to widely support the ability of passing params no matter which kind of navigator/router are you using, as otherwise forces us to share information by using an external module with state, that as you know this should be avoided as much as possible, since complicates testing, and other stuff. I also thing that in the future we should try to introduce a change that let us separate route params and route state as I described here since IMHO this concepts are different, but this is a subject of a different conversation. |
Ok, this looks like a well-documented fix to a pretty common problem. Thanks for the contribution! |
Awesome! Is this somewhere in the documentation? Couldn't find it. |
(for more info see this comment I left in the issue)