I am using React Native Expo Router SDK 52 that uses file-based routing to navigate between screens. I am experiencing a slight malfunctioning of either VS Code or Expo and I have closed VS Code and restarted it many times but it was not solved. Expo is not detecting some files and directories created inside app directory, so it is not allowing other pages to navigate to those undetected files and directories. Normally, Expo treats all files and directories inside the app directory as route but it is not detecting some files and directories inside the app directory.
*****What I have tried
I have closed and opened VS Code but it is still not detecting some screens in the app directory. Expo did not detect some files and directories created in the app directories when I use the following code:
router.push('/')
router.navigate('/')
......
The Expo 52 comes with (tab) directory inside the app directory, it can detect the (tab) directory and i created another directory called (users), it detected this (users) directory but not all the files inside it and it did not detect (payments) directory and the files in it.
What could be the problem please?
This is how my directory structure looks like below
enter image description here
I am using React Native Expo Router SDK 52 that uses file-based routing to navigate between screens. I am experiencing a slight malfunctioning of either VS Code or Expo and I have closed VS Code and restarted it many times but it was not solved. Expo is not detecting some files and directories created inside app directory, so it is not allowing other pages to navigate to those undetected files and directories. Normally, Expo treats all files and directories inside the app directory as route but it is not detecting some files and directories inside the app directory.
*****What I have tried
I have closed and opened VS Code but it is still not detecting some screens in the app directory. Expo did not detect some files and directories created in the app directories when I use the following code:
router.push('/')
router.navigate('/')
......
The Expo 52 comes with (tab) directory inside the app directory, it can detect the (tab) directory and i created another directory called (users), it detected this (users) directory but not all the files inside it and it did not detect (payments) directory and the files in it.
What could be the problem please?
This is how my directory structure looks like below
enter image description here
Share Improve this question edited Feb 3 at 17:50 Raul Hernandez asked Feb 3 at 14:37 Raul HernandezRaul Hernandez 114 bronze badges 4 |1 Answer
Reset to default 0You'll need to create a _layout.tsx
file inside each subdirectory. Inside this _layout.tsx
file, you'll need to define the structure for the navigation:
...
<Stack>
<Stack.Screen name="screen1" />
<Stack.Screen name="screen2" />
...
</Stack>
...
_layout.tsx
file inside(store_mechant)
and(users)
? – Chibuokem Onyekwelu Commented Feb 3 at 19:28