T
TanStack4d ago
genetic-orange

Virtual physical routes

In virtual routesphysical('/posts', 'posts'),
└── posts
├── route.tsx (layout file not working)
├── index.tsx
├── $postId.tsx
├── $postId.edit.tsx
├── comments/
│ ├── index.tsx
│ ├── $commentId.tsx
└── likes/
├── index.tsx
├── $likeId.tsx
└── posts
├── route.tsx (layout file not working)
├── index.tsx
├── $postId.tsx
├── $postId.edit.tsx
├── comments/
│ ├── index.tsx
│ ├── $commentId.tsx
└── likes/
├── index.tsx
├── $likeId.tsx
└── posts
├── directory
└─├── route.tsx (now working fine)
├── index.tsx
├── $postId.tsx
├── $postId.edit.tsx
├── comments/
│ ├── index.tsx
│ ├── $commentId.tsx
└── likes/
├── index.tsx
├── $likeId.tsx
└── posts
├── directory
└─├── route.tsx (now working fine)
├── index.tsx
├── $postId.tsx
├── $postId.edit.tsx
├── comments/
│ ├── index.tsx
│ ├── $commentId.tsx
└── likes/
├── index.tsx
├── $likeId.tsx
we need to create an additional directory to make route.tsx work as layout wrapper. it is expected behavior. https://stackblitz.com/edit/github-93ulbqhx?file=routes.ts in this official example this hack is found.
Steve Steinitz
StackBlitz
Router Basic Virtual File Based Example - StackBlitz
Run official live example code for Router Basic Virtual File Based, created by Tan Stack on StackBlitz
1 Reply
adverse-sapphire
adverse-sapphire4d ago
seems like a bug. can you please create a GitHub issue for this?

Did you find this page helpful?