question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request :: Nested URLs without Nesting Layouts

See original GitHub issue

Having support for convention-based nested URLs while being able to escape from the default layout convention in a given folder would be awesome. 😄

As per the remix.run docs: https://remix.run/docs/en/v1/guides/routing#nested-urls-without-nesting-layouts

So, if we want a flat UI hierarchy, we create a flat filename–we use “.” to create segments instead of folders. This defines URL nesting without creating component nesting.

└── app
    ├── root.jsx
    └── routes
        ├── sales
        │   ├── invoices
        │   │   └── $invoiceId.jsx
        │   └── invoices.jsx
        ├── sales.invoices.$invoiceId.edit.jsx 👈 not nested
        └── sales.jsx

Just for absolute clarity, if the url is “example.com/sales/invoices/2000/edit”, we’ll get this UI hierarchy that matches the file system hierarchy:

<Root>
  <EditInvoice />
</Root>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
davemocommented, Oct 20, 2022

Thank you for the examples! ❤️

1reaction
oedotmecommented, Oct 20, 2022

Yup, that’s supported with multiple params as well, thanks to @bzbetty. Here’s an example:

image
Read more comments on GitHub >

github_iconTop Results From Across the Web

Remix nested URLs without the layout nesting - Daily Dev Tips
Yesterday we learned how to create pathless layout routes, which means we can share a layout between routes without sharing the URL routes....
Read more >
Feature request: Reset layout inheritance in nested routes ...
I would like an API that allows me as developer to get more flexibility when needed but has the layout inheritance by default....
Read more >
Basic Features: Layouts - Next.js
This new directory has support for layouts, nested routes, and uses Server Components by default. Inside app/ , you can fetch data for...
Read more >
Remix Routes Demystified - Smashing Magazine
There is a chance that developers will need to create layouts without nesting routes. Take for example the /about page and the /...
Read more >
Performance and view hierarchies - Android Developers
Android Layouts allow you to nest UI objects in the view hierarchy. ... is when hierarchies of View objects are nested within one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found