react-nativemobileexpo

How can I remove pages that I don't want to appear on the bottom bar in expo router


I am using expo's own router structure. in the layout it automatically adds pages to the bottom bar, I want to remove some pages.


Solution

  • You can hide the views by passing the prop href: null. see the docs https://expo.github.io/router/docs/guides/tabs#hiding-a-tab

    
    export default function AppLayout() {
      return (
        <Tabs>
          <Tabs.Screen
            // Name of the route to hide.
            name="index"
            options={{
              // This tab will no longer show up in the tab bar.
              href: null,
            }}
          />
        </Tabs>
      );
    }