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
correct-apricotOP•11mo ago
It works by creating two separate folders like so:
But is it the ideal solution ?
afraid-scarlet•11mo 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?afraid-scarlet•11mo 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...
correct-apricotOP•11mo 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 ?
afraid-scarlet•11mo 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 pathscorrect-apricotOP•11mo ago
alright, thank you