Files
Hendrik LiebauandGitHub af74b4a36f Include use-cache test suite in the Cache Components tests (#81610)
We're splitting the test app routes between two root layouts, one for (partially) static pages that does not wrap its children in a Suspense boundary, and one for dynamic pages that adds a Suspense boundary above `body`, which opts those pages into fully dynamic rendering.

Two tests are expected to fail for now, because they revealed bugs related to revalidation, which will be fixed in follow-up PRs:
- https://github.com/vercel/next.js/pull/81611
- https://github.com/vercel/next.js/pull/81621

closes NAR-171
2025-07-16 13:05:25 +02:00

23 lines
474 B
TypeScript

import { revalidatePath } from 'next/cache'
import { RevalidateButtons } from './revalidate-buttons'
async function cachedValue() {
'use cache'
return Math.random()
}
export default async function Page() {
const value = await cachedValue()
return (
<div>
<p id="value">{value}</p>
<RevalidateButtons
revalidatePath={async () => {
'use server'
revalidatePath('/on-demand-revalidate')
}}
/>
</div>
)
}