mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? When using interception routes & rewrites, on first interception the router will properly handle the request. But when using the back button and attempting another interception, it won't work ### Why? Intercepting routes rely on the accuracy of `nextUrl` -- but when `ACTION_RESTORE` is dispatched (in the `popstate` event), `nextUrl` is restored from `url.pathname` rather than the flight router state. ### How? This uses the `extractPathFromFlightRouterState` util which will properly handle setting `nextUrl`. This util is also used when creating the initial router state. Closes NEXT-1747 Fixes #56072
19 lines
427 B
TypeScript
19 lines
427 B
TypeScript
import Link from 'next/link'
|
|
|
|
export default function Layout({ children, modal, params }) {
|
|
return (
|
|
<>
|
|
<div>
|
|
<Link href="/feed">feed</Link>
|
|
</div>
|
|
<div>
|
|
Photos: <Link href="/photos/1">Photo 1</Link>{' '}
|
|
<Link href="/photos/2">Photo 2</Link>
|
|
</div>
|
|
<div>{params.lang}</div>
|
|
<div id="children">{children}</div>
|
|
<div id="modal">{modal}</div>
|
|
</>
|
|
)
|
|
}
|