Replies: 9 comments 9 replies
-
Am I right in this doesn't work if you add another layout in |
Beta Was this translation helpful? Give feedback.
-
This worked for me on 13.5.6. I updated today and to my surprise this was no longer working. It would be nice to have this back. |
Beta Was this translation helpful? Give feedback.
-
Hey I'll drop a question that is somehow related to this, I've this folder structure
When I try to access to /profile/settings, it shows me a 404. What could be the reason?
|
Beta Was this translation helpful? Give feedback.
-
Have there been any new workarounds/solutions for this in the meantime? I'd also like to share some of my thoughts. My ExperienceI frequently have the case where certain pages should show something next to a layout's component. This can be e.g. showing a title of an intermediate route in a top-level sidebar or showing breadcrumbs. Right now, the only solutions are seemingly:
Problems with maintainabilityBoth solutions mean that you have to go out of the current route context to make this happen. I.e. you need to recreate the routing logic either in code (client component) or with a folder structure, right next to the folder structure you already set up.
|
Beta Was this translation helpful? Give feedback.
-
Parallel routes should be supported at any level of the file tree, please! Workarounds for this in real projects are pain points. And please please please at least update the docs to reflect current limitations. Please consider this docs pr, #69380 |
Beta Was this translation helpful? Give feedback.
-
Has there been a fix for this yet? |
Beta Was this translation helpful? Give feedback.
-
Here's how to do this in version 14; it probably works in v15 as well: My first instinct was to organize routes via functional areas like:
But as the issues says, this does not work. However, organizing each slot with its own hierarchy of routes does work.
I can the appeal of both ways. But Vercel... this should really be documented. |
Beta Was this translation helpful? Give feedback.
-
Thanks Jon, I will give it a bash. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to make like /[boardId]
/@actionPanel
/@actionList
default.tsx
default.tsx
layout.tsx // to get /@actionList with props
layout.tsx // to get /@actionPanel I have tried this. It's working in Development environment but in production environment after build it's getting only default.tsx instead of nested layout.tsx in @/actionPanel |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
Slots are a perfect fit for allowing modals to work with browser history in Next.js. However, I commonly want to use a modal dialog from an arbitrarily nested path, not just the direct children of the layout.
Take a directory structure like this.
Currently this wouldn't work, since
foo
is betweenlayout.tsx
and@modal
.Proposal
I'd like it if slots would work with the nearest
layout.tsx
file up the hierarchy, rather than just the one in the current directory.Even better would be searching up the tree for a layout with the matching
modal: ReactNode
prop, since I may want an intermediate layout without forcing it to handle themodal
slot itself.Beta Was this translation helpful? Give feedback.
All reactions