Learn how to use a top-level src directory in your Expo Router project.
As your project grows, it can be helpful to move all of the directories containing application code into a single src directory. Expo Router supports this out of the box.
src
app
_layout.js
index.js
components
button.js
package.json
Simply move your app directory to src/app and restart the development server with a clear cache:
-
npx expo start --clear
# Or when exporting
-
npx expo export --clear
Notes: