I want to hide bottom tab bar in many screens so for that I am trying to access the route name of the screens. The stack is like this:
AuthStack > BottomTab> Each tab has a stack nested to it so let's take AccountStack> Containing screens
I want to hide bottom tab for account stack screens
I tried getting the route names but on any screen I go inside AccountStack I get Account route name only, it doesn't change
I want to get the current route name inside the file where I made bottomstack so that I can hide the bottom tab according to the screens
const navigationState = useNavigationState(state => state);
const currentRouteName = navigationState.routes[navigationState.index].name;