Enable customizing the root directory (/app
)
#259
Replies: 8 comments 4 replies
-
+1 Definetely needed. |
Beta Was this translation helpful? Give feedback.
-
It also makes import aliasing difficult, I had to resort to regex for the babel module |
Beta Was this translation helpful? Give feedback.
-
It should indeed be supported. But in the meantime you could still split screens and other files into two separate folders
You can easily make absolute imports by adding something like that in
And this in babel.config.js
|
Beta Was this translation helpful? Give feedback.
-
It would be great if this was a first class feature, the latest version of |
Beta Was this translation helpful? Give feedback.
-
Does expo-router treat files in the |
Beta Was this translation helpful? Give feedback.
-
This is just something very painful to see that expo router doesn't support it. In the end what exactly is expo router for anyways if you already have full support with Stack Navigator. I mean come on. I get bug into bug with this library. |
Beta Was this translation helpful? Give feedback.
-
Here's the solution that I've been using for my current project which require just 2 small changes to the initial Getting Started setup: Step 1.You have to set an environment variable that expo-router uses internally to locate the In your
Step 2.In the root
Step 3:Enjoy 🥳 |
Beta Was this translation helpful? Give feedback.
-
Expo Router v2 supports |
Beta Was this translation helpful? Give feedback.
-
Summary
expo-router
package only loads pages that are directly in the/app
directory.Many projects end up having many directories (like
/types
,/utils
, etc.) and managing them is easier when you put your app's code in/src
directory.That's why I think supporting
/src/app
directory for pages is really important - eg. see NextJS, it allows you to use/src/pages
structure.Minimal reproducible example
https://github.com/PiotrekPKP/expo-router-test
This should work and not show the default router layout ^
Beta Was this translation helpful? Give feedback.
All reactions