next.js/test/e2e/app-dir/use-cache/app/(partially-static)/nested-in-unstable-cache/page.tsx
page.tsx25 lines452 B
import { revalidatePath, unstable_cache } from 'next/cache'

async function inner() {
  'use cache'
  return Math.random()
}

const outer = unstable_cache(async () => {
  return inner()
})

export default async function Page() {
  return (
    <form
      action={async () => {
        'use server'
        revalidatePath('/nested-in-unstable-cache')
      }}
    >
      <p>{await outer()}</p>
      <button>Revalidate path</button>
    </form>
  )
}
Quest for Codev2.0.0
/
SIGN IN