
How to handle dynamic navigation with Expo Router? (Role-based menus)
Hi everyone, I need some help!!
I’m currently migrating my application from another framework to Expo, and I’m using Expo Router.
The app is fairly simple: after the user logs in, I retrieve a list of modules/screens assigned to that user. Then, I navigate to a main screen called MainMenu, which is shared by all users. On this screen, I display a list organized by module. Each module appears as a collapsible/expandable option, and when the user selects it, the corresponding screens assigned to that module are shown. Selecting one of those options should navigate to the respective screen.
My backend already returns this structure: a list of modules and screens. Each module has its own key and name, and each screen includes its title, icon, and route. This approach worked well for me in the past.
However, I’m not sure how to implement this kind of dynamic navigation with Expo Router.
If anyone has recommendations, useful articles, or perhaps an open-source project where a similar approach has been implemented, I would really appreciate it.
also, if you have a similar project please advice me with your folder structure, currently i'm trying to follow this: How to organize Expo app folder structure for clarity and scalability