Search code examples
exporouterexpo-router

How to ignore a folder from navigation in expo-router?


Simple and maybe dumb question, but I don't see anywhere in the doc where can I completely ignore a folder from navigation.

I have for example a src/service folder, where there are no 'pages' nor nothing UI related, so I want to completely igonore it

What is the right way to handle this scenario ?


Solution

  • Which version of expo-router are you using? If you are using version 2.0 then expo-router would look for pages only in /app or the /src/app directories and the src/service folder is automatically ignored. See here.

    If using version 1, then expo-router would only be looking at the /app directory for the pages.