How would you translate this to directory routes ?
Hey I have these flat routes:
How would you convert this to directory routes ? I tried but I have issues with the non-nested routes (_) not rendering in their own component tree.
6 Replies
xenial-blackOP•8mo ago
It works by creating two separate folders like so:
But is it the ideal solution ?
molecular-blue•8mo ago
depends on your definition of "ideal" 😄
but how else would you tell router that the stuff beneath
companies_
shall contain the companies
in the path but not nest underneath it?molecular-blue•8mo ago
the only other other way I see is https://tanstack.com/router/v1/docs/framework/react/guide/virtual-file-routes
Virtual File Routes | TanStack Router React Docs
We'd like to thank the Remix team for . We've taken inspiration from their work and adapted it to work with TanStack Router's existing file-based route-tree generation. Virtual file routes are a power...
xenial-blackOP•8mo ago
Yea I see, I'll stick with the two folders solution
@Manuel Schiller Sorry to bother you again, but I am curious, how would you accomplish this with virtual file routes ?
molecular-blue•8mo ago
something like this
you can of course omit the
companies-details
layout, this example is just showing how you can apply different layouts to similar pathsxenial-blackOP•8mo ago
alright, thank you