Unverified Commit d1d29cc2 authored by Ivo Biaus's avatar Ivo Biaus Committed by GitHub

Update default.mdx (#63678)

Corrected the indicated URL, since based on the image it's referring to,
there is no "dashboard" parent folder around settings.
Image of reference:

![image](https://github.com/vercel/next.js/assets/43274372/337bf077-4cb6-4900-8f29-6af506097078)
parent 8d979b62
...@@ -64,7 +64,7 @@ export default function Layout({ children, team, analytics }) { ...@@ -64,7 +64,7 @@ export default function Layout({ children, team, analytics }) {
} }
``` ```
However, slots are **not** [route segments](/docs/app/building-your-application/routing#route-segments) and do not affect the URL structure. For example, for `/dashboard/@analytics/views`, the URL will be `/dashboard/views` since `@analytics` is a slot. However, slots are **not** [route segments](/docs/app/building-your-application/routing#route-segments) and do not affect the URL structure. For example, for `/@analytics/views`, the URL will be `/views` since `@analytics` is a slot.
> **Good to know**: > **Good to know**:
> >
...@@ -95,7 +95,7 @@ Consider the following folder structure. The `@team` slot has a `/settings` page ...@@ -95,7 +95,7 @@ Consider the following folder structure. The `@team` slot has a `/settings` page
height="930" height="930"
/> />
When navigating to `/dashboard/settings`, the `@team` slot will render the `/settings` page while maintaining the currently active page for the `@analytics` slot. When navigating to `/settings`, the `@team` slot will render the `/settings` page while maintaining the currently active page for the `@analytics` slot.
On refresh, Next.js will render a `default.js` for `@analytics`. If `default.js` doesn't exist, a `404` is rendered instead. On refresh, Next.js will render a `default.js` for `@analytics`. If `default.js` doesn't exist, a `404` is rendered instead.
...@@ -183,15 +183,15 @@ For example, the `@analytics` slot has two subpages: `/page-views` and `/visitor ...@@ -183,15 +183,15 @@ For example, the `@analytics` slot has two subpages: `/page-views` and `/visitor
Within `@analytics`, create a [`layout`](/docs/app/building-your-application/routing/pages-and-layouts) file to share the tabs between the two pages: Within `@analytics`, create a [`layout`](/docs/app/building-your-application/routing/pages-and-layouts) file to share the tabs between the two pages:
```tsx filename="app/dashboard/@analytics/layout.tsx" switcher ```tsx filename="app/@analytics/layout.tsx" switcher
import Link from 'next/link' import Link from 'next/link'
export default function Layout({ children }: { children: React.ReactNode }) { export default function Layout({ children }: { children: React.ReactNode }) {
return ( return (
<> <>
<nav> <nav>
<Link href="/dashboard/page-views">Page Views</Link> <Link href="/page-views">Page Views</Link>
<Link href="/dashboard/visitors">Visitors</Link> <Link href="/visitors">Visitors</Link>
</nav> </nav>
<div>{children}</div> <div>{children}</div>
</> </>
...@@ -199,15 +199,15 @@ export default function Layout({ children }: { children: React.ReactNode }) { ...@@ -199,15 +199,15 @@ export default function Layout({ children }: { children: React.ReactNode }) {
} }
``` ```
```jsx filename="app/dashboard/@analytics/layout.js" switcher ```jsx filename="app/@analytics/layout.js" switcher
import Link from 'next/link' import Link from 'next/link'
export default function Layout({ children }: { children: React.ReactNode }) { export default function Layout({ children }: { children: React.ReactNode }) {
return ( return (
<> <>
<nav> <nav>
<Link href="/dashboard/page-views">Page Views</Link> <Link href="/page-views">Page Views</Link>
<Link href="/dashboard/visitors">Visitors</Link> <Link href="/visitors">Visitors</Link>
</nav> </nav>
<div>{children}</div> <div>{children}</div>
</> </>
......
...@@ -21,7 +21,7 @@ Consider the following folder structure. The `@team` slot has a `settings` page, ...@@ -21,7 +21,7 @@ Consider the following folder structure. The `@team` slot has a `settings` page,
height="930" height="930"
/> />
When navigating to `/dashboard/settings`, the `@team` slot will render the `settings` page while maintaining the currently active page for the `@analytics` slot. When navigating to `/settings`, the `@team` slot will render the `settings` page while maintaining the currently active page for the `@analytics` slot.
On refresh, Next.js will render a `default.js` for `@analytics`. If `default.js` doesn't exist, a `404` is rendered instead. On refresh, Next.js will render a `default.js` for `@analytics`. If `default.js` doesn't exist, a `404` is rendered instead.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment