React Navigation loses screen - react-native

I have a small app with React Navigation v6 composed of a bottomTabNavigator with 3 tabs, the first two tabs are stackNavigators, the third tab is just a profile screen for the user.
First tab stack has 2 screens, a screen for list of active news about products (initial screen for the stack) and the second screen in the stack is for historic news (already read news).
Second tab stack has algo 2 screens: a screen with a list of products (initial screen for the stack) and a screen with details about the product
First time I open the app it will load the screen with the list of active news, I can press the products tab and it will show me the list of products screen no problem, then I can go back and keep navigating back and foward. The problem is if i load the app from scratch and in the first screen (the active news screen) if I click on an item it navigates to the second tab and to the screen of product details (thats the correct flow), but from now onwards the product list screen is forever lost, I have no way of navigating there, tried pressing back, pressing the tab, everything, but can't get there. Its like if I haden't "loaded" it at first then its lost.
Is this a bug or am I missing something? Thanks in advance!

Related

How to jump from one screen to another and clear all other screen from stack in ReactNative?

I have an application where I have a tab screen and few screens.
From tab I navigate in order screen 1 -> screen 2 -> screen 3 .
From screen 3's button click, I want to open screen - 4 i.e listing screen and on backpress I want to navigate agin tab screen.
I dont want to reset full stack using props.navigation.reset({index: 0,routes: [{name: "home"}],});, also number of navigating screen between tab screen and screen 4 is not fixed so I can't use props.navigation.pop(3) also.
Can anyone guide me, how to achieve this?
Thanks in advance
I found a way to achieve above navigation.
props.navigation.popToTop();
This will remove all screen from stack except main screen.
Hope this helps others!!

React Native & React Navigation 5.x: hiding bottom tab bar in specific screens

I'm currently building an app that has a bottom tab bar with a navigation stack in each tab. Now I want to create an image screen where the tab bar is hidden. I've followed the docs at https://reactnavigation.org/docs/hiding-tabbar-in-screens, which works fine if you only want the user to able to navigate to the screen and then navigate back to the tab stack.
The problem is that I want it to feel like the image screen is part of the tab stack so the user can navigate from the image screen to another screen (i.e. push another screen on top of the stack). This doesn't work for me using the method mentioned above...
I've also tried using the option tabBarVisible: false, but it makes the "hide animation" glitchy (which the docs also warns for: https://reactnavigation.org/docs/bottom-tab-navigator).

TabBar in React Navigation

I need help in React Navigation when I create a tab bar like I have button home and I want to access another screen in the Home with show tab bar inside it to keep selected on the Home icon.
First Screen
Second Screen
I want show tabBar with continue select Home button.
This solved my problem by A stack navigator for each tab.
https://reactnavigation.org/docs/tab-based-navigation/?fbclid=IwAR071_HAYPP9NYGbVHq88j1ZssyBn8226Qnne_PzUdGdIM56XrVD5shU10c#a-stack-navigator-for-each-tab
I think you should have a variable that would keep track of the home page and when you are on it and thus provide the styling you need on the homepage icon....and when you are in the second screen it should be still be set to true so nothing changes

How can I tell when a component is the root of its stack in react native navigation?

I am using react-native-navigtion and have 4 tabs. Tab 1 is the home screen, tabs 2-4 have a navigation stack in each. Tabs 2-4 are made up of a re-usable component so, there is no clear root component. When in the root screen of tabs 2-4, I want the android back button to take me to tab 1. I have found how to hook into the android back button, but I need to know if I am at the navigation root before sending a person to tab 1 (home).
Thanks in advance

Persist certain elements on screen without refreshing when navigating

Using stacknavigator, whenever user navigates to a new screen everything on the screen flashes out, then back in even if the elements are the same on both starting and ending screen. For example, I have a searchbar at the top of every page and sticky footer at the bottom. Is there any way to keep those elements on the screen during the navigation?
Ideal result is like with Tabnavigator, the tabs stay on screen during navigation.