mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Extracted from #94595 . The root layout includes a timestamp that we use to check if the root layout changed during a navigation, but it was unnecessarily using `await connection(); Date.now()` when a `performance.now()`would be enough. Changing it to not introduce a random dynamic hole which could affect validation in some way. This change revealed that some client component tests were implicitly relying on the dynamic timestamp component as a workaround for NAR-800 . I've added a workaround dynamic component to each of the relevant tests, those can be removed when we fix the bug.
24 lines
437 B
TypeScript
24 lines
437 B
TypeScript
import { ReactNode } from 'react'
|
|
import { RootLayoutTimestamp } from '../shared'
|
|
|
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
return (
|
|
<html>
|
|
<body style={{ fontFamily: 'monospace' }}>
|
|
<Header />
|
|
<hr />
|
|
{children}
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|
|
|
|
function Header() {
|
|
return (
|
|
<header>
|
|
<a href="/">Home</a>
|
|
<RootLayoutTimestamp />
|
|
</header>
|
|
)
|
|
}
|