Files
Andrew ClarkandGitHub 954354f2ab [Segment Cache] Re-implement refresh reducer (#84426)
This re-implements the refresh reducer to use the Segment Cache-style
flow, similar to how the navigate reducer already works.

Most of the logic can be reused from what was already implemented for
navigations. The bulk of the changes are related to the case where a
"default" parallel route slot is not present on the current page, and so
needs to be refreshed from an older page's URL.

Theoretically, this should be the last remaining case where we rely on
the lazy fetching logic in LayoutRouter. I think there may still be some
error cases where we still rely on that, though. Once these are all
addressed, we can remove the lazy-fetching mechanism entirely.
2025-11-18 18:38:47 -05:00

29 lines
874 B
TypeScript

import { Suspense } from 'react'
import { connection } from 'next/server'
import { RenderCounterClient } from './client'
async function DynamicRenderCounter(): Promise<React.ReactNode> {
// Renders a count of the number of times the client receives new dynamic data
// from the server. The count is computed on the client and stored in React
// state, so it gets reset if the state of the tree is reset.
await connection()
const uuid = crypto.randomUUID()
return <RenderCounterClient uuid={uuid} />
}
export default function DashboardNavbarLandingPage() {
return (
<div>
<p>Navbar</p>
<Suspense fallback={<div>Loading...</div>}>
<p>
Navbar dynamic render counter:{' '}
<span id="navbar-dynamic-render-counter">
<DynamicRenderCounter />
</span>
</p>
</Suspense>
</div>
)
}