The easiest solution to start with a small expo application while using expo router is to add a components folder inside your solution and store all components there.
Im starting to think ahead and trying to design a solution that can grow and scale.
If i have a big and complex pageon the route app/complexPage/index.tsx, i wanna divide this into several small and custom components (maybe some of them are not reusable and are used by complexPage only).
I want to avoid generate a component inside my index.tsx file. My dream rule would be to generate every component inside its own file.
But that rule generate another problem for me. If i save that file inside app/complexPage/components/customComponent.tsx that file becomes part of the available routes of the expo router library: ‘complexPage/components/customComponent’ is a valid route right? I want to avoid that.
On the other hand, i do not want to generate a duplicated file structure like this inside the components folder every time i have a component that is not a navigable -> components/complexPage/customComponent.tsx
On this solution i have to duplicate the folder structure inside app and components folders.
Is there any smart way to add this component folder and its custom components inside app folder and mark them in any way posible as not navigable components?
Currently im going with the components folder aproach at the root of the project but i dont like it to much for the reasons explained previously