0

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;
  • 1
    Does this answer your question? [How to hide bottom navigation bar on a specific screen in react native?](https://stackoverflow.com/questions/56745881/how-to-hide-bottom-navigation-bar-on-a-specific-screen-in-react-native) – Abe May 27 '23 at 17:42
  • It does solve the issue but it messes up the tab bar. The tab bar actually shrinks when I mount in again. Can you please suggest something on it? –  May 29 '23 at 07:02

0 Answers0