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.

This should be fairly easy to implement; comment here if you need this and this will be implemented (ETA within a week).

The idea is to export const isNested = true in .page.route.js.

/pages/product/@id/index.page.js

/pages/product/@id/reviews.page.js
/pages/product/@id/reviews.page.route.js

/pages/product/@id/pricing.page.js
/pages/product/@id/pricing.page.route.js
// /pages/product/@id/reviews.page.route.js
export const isNested = true
// /pages/product/@id/pricing.page.route.js
export const isNested = true
// /pages/product/@id/index.page.js

// The parent page
export function Page() {
  const pageContext = usePageContext()
  const { Page: NestedView } = pageContext.nested[0]
  // ...
}

The onBeforeRender() hooks of all .page.js matching the same URL are called in parallel.

The parent onBeforeRender() hooks are cached if the URL segment didn’t change for the parent .page.js.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:10
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
brilloutcommented, Oct 5, 2022

The overall design is starting to crystalize.

The Single Route File design will play a central role here.

Stay tuned.

As always, if this is urgent for someone, then definitely let me know!

3reactions
Jearcecommented, Jul 25, 2022

This feature would be great to use in my current project. Currently, using the solution given here. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nesting Of Layouts In Android With Example
Below is the example of Nesting Of Layouts in which we create Nested Layout's. By the term of Nested we mean one Layout...
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 >
Nested layouts - IBM
Nested layouts. Describes how to perform a layout on a nested graph and explains the utilities that are available for nested graphs. In...
Read more >
Android nested layouts - Stack Overflow
Well some layouts can only be made by doing some level of nesting. But you should avoid having too many nested LinearLayouts and...
Read more >
Nested layouts - Blazor University
This means that a custom layout can also have its own parent layout. Next we'll create a custom layout for the. Edit the...
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