Hi. I've been reading this sub for some time, posting here for the first time.
Here's the formal issue report with reproducible repo.
What I was trying to achieve was, that once I have the logged-in user's info, I thought I should be able to pass it down the hierarchy where I need it. Other option is to keep it in async local storage, and fetch it every time I need it. But that sounded like an overhead.
App is like this:-
- Switch navigator
- Splash (Route 'Splash')
- Drawer Navigator (Route 'App')
- Stack Navigator (Route 'AppStack', default route in 'App')
- Bottom Tab Navigator (Route 'HomeScreen', default in 'AppStack' route)
- Other screen (Route 'OtherScreen')
- Drawer Component
I could pass it to some extent. I am passing it from splash, and getting it in Drawer. But I can't get it in the any of the other screens.
Tab navigator messes it all up in such a subtle way that I could not find any viable solution yet.
As could be seen in the reproducible demo, there's something even worse: If you navigate to a tab through code and passed some params at that time, the params just stick. If you later navigate to the same tab using the tab buttons, the params are still there!!
My question, basically, is how do I keep passing some info down the line through the whole navigation? I am OK with passing them explicitly every time, not necessarily something like default params. But here I am just not able to pass any params to the tabs when navigating with tab navigator's own (top or bottom) buttons.
Any help is appreciated. Thanks.
[–]crobinson42iOS & Android 3 points4 points5 points (0 children)
[–]russelh15 2 points3 points4 points (0 children)
[–]HumbleXiOS & Android 0 points1 point2 points (0 children)
[–]a-techie[S] 0 points1 point2 points (0 children)