I was reading the docs and found this
<code>Scaling
Our general recommendation for scale is to make every route a folder and put the modules used exclusively by that route in the folder, then put the shared modules outside of routes folder elsewhere. This has a couple benefits:
Easy to identify shared modules, so tread lightly when changing them
Easy to organize and refactor the modules for a specific route without creating "file organization fatigue" and cluttering up other parts of the app
</code>
<code>Scaling
Our general recommendation for scale is to make every route a folder and put the modules used exclusively by that route in the folder, then put the shared modules outside of routes folder elsewhere. This has a couple benefits:
Easy to identify shared modules, so tread lightly when changing them
Easy to organize and refactor the modules for a specific route without creating "file organization fatigue" and cluttering up other parts of the app
</code>
Scaling
Our general recommendation for scale is to make every route a folder and put the modules used exclusively by that route in the folder, then put the shared modules outside of routes folder elsewhere. This has a couple benefits:
Easy to identify shared modules, so tread lightly when changing them
Easy to organize and refactor the modules for a specific route without creating "file organization fatigue" and cluttering up other parts of the app
So decided to migrate all my routes to a folder structure, ending up like this
<code>routes/
│
├── _index.tsx
├── category/
│ ├── $categoryId.tsx
├── completed/
│ ├── route.tsx
├── login/
│ ├── route.tsx
├── process_tasks/
│ ├── route.tsx
</code>
<code>routes/
│
├── _index.tsx
├── category/
│ ├── $categoryId.tsx
├── completed/
│ ├── route.tsx
├── login/
│ ├── route.tsx
├── process_tasks/
│ ├── route.tsx
</code>
routes/
│
├── _index.tsx
├── category/
│ ├── $categoryId.tsx
├── completed/
│ ├── route.tsx
├── login/
│ ├── route.tsx
├── process_tasks/
│ ├── route.tsx
They all seem to work except
<code>/category/1
</code>
<code>/category/1
</code>
/category/1
IT says 404 not found
How would I solve the folder structure to make it work?
And on the other hand, why do I need to put
_index.tsx
with an underscore for /
to work ? if i simply put index.tsx
it wont load anything