Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop displaying New file as an menu list in expo router?

I am working on expo router trying to develop android application. During development I Observe that if I am creating any new file it is showing in menu, like if I am using tab navigation using expo router and created a new file which is showing as menu in bottom tab. Similarly in drawer menu also.

Can anyone help me how I can fix that issue ?

However maybe it is default behaviour of expo router but I don't want to show each file in menu.

like image 849
msrajwat298 Avatar asked Sep 18 '25 11:09

msrajwat298


2 Answers

That is exactly the default behaviour of expo router. The app folder is supposed to contain Only files corresponding to screens. For all other files, create them outside ‘app’ folder. For example, you might have /src/app, /src/components, and so on.

like image 58
Pankaj_Saini Avatar answered Sep 21 '25 12:09

Pankaj_Saini


This will do the trick:

  <Tabs.Screen
      name="your/route/to/hide"
      options={{
          href: null,
      }}
  />

https://docs.expo.dev/router/advanced/tabs/#advanced

like image 45
Dan Sadler Avatar answered Sep 21 '25 10:09

Dan Sadler