How can I create a folder within the /app/routes directory in a React Remix application purely for organizational purposes? For example, if I have 30 files that I want to organize into different folders in the code, but without affecting the URL structure. I want the URL to remain as /test.tsx and not include the folder name, like /folder1/test.tsx. I heard there might be a way to do this by naming the folder, but I’m not sure how it works or how to implement it.
I read through the Remix framework documentation, but it seems I might be misunderstanding something. I am using v2, although I’m not entirely sure how to confirm this. I tried prefixing folder names with an underscore, like /app/routes/_folder1/test.tsx or /app/routes/**__folder1/**test.tsx, but it didn’t have any effect. When I accessed the page (i.e., localhost:port/test.tsx), I received a 404 error both in the terminal and on the page.
JustCool is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.