mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Stacked on https://github.com/vercel/next.js/pull/84877, https://github.com/vercel/next.js/pull/84880 This PR adds a codemod for removing the `unstable_` prefix for stabilized APIs. It is considered to scale by adding more APIs to the `UNSTABLE_TO_STABLE_MAPPING` map in the future to this codemod. Closes NEXT-4739
18 lines
416 B
TypeScript
18 lines
416 B
TypeScript
// @ts-nocheck
|
|
/* eslint-disable */
|
|
const { unstable_cacheTag, unstable_cacheLife, revalidatePath } = require('next/cache')
|
|
|
|
export function MyComponent() {
|
|
const tag = unstable_cacheTag('my-tag')
|
|
const life = unstable_cacheLife('2 hours')
|
|
|
|
// This should remain unchanged
|
|
revalidatePath('/app')
|
|
|
|
return (
|
|
<div>
|
|
<p>Using cache tag: {tag}</p>
|
|
<p>Using cache life: {life}</p>
|
|
</div>
|
|
)
|
|
} |