79542792

Date: 2025-03-29 04:34:27
Score: 1
Natty:
Report link

The Reason For This

  1. Folder with index.tsx

    When you create a folder (like admin) and include an index.tsx, the fs-routes engine uses that file to generate the route for /admin. Any additional files in that folder (such as users.tsx) aren’t automatically turned into child routes.

  2. Dot Notation Files

    The automatic route generation relies on a naming convention where the dot separates the parent and child route names. For example, admin.users.tsx clearly indicates a child route under /admin.

The Solutions For The Issue

  1. Use Dot Notation

    Move the users.tsx file out of the admin folder and rename it to admin.users.tsx. This will automatically generate the desired /admin/users route.

  2. Manually Nest Routes

    If you prefer to keep the folder structure for organization, you can keep your files in the folder and then manually define the nested routes inside admin/index.tsx by importing and rendering them as children routes.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Vinuka Osura