next.js
e586cda3 - Update revalidateTag examples to use the new two-argument signature (#92065)

Commit
101 days ago
Update revalidateTag examples to use the new two-argument signature (#92065) ### What? Updated all documentation examples of `revalidateTag` to use the new two-argument signature (`revalidateTag(tag, 'max')`) instead of the deprecated single-argument form (`revalidateTag(tag)`). ### Why? The `revalidateTag` API now requires a second `profile` argument. Using the old single-argument form causes a TypeScript build error: "Expected 2 arguments, but got 1". Several documentation pages still showed the old signature, which would lead developers to write code that fails to compile. ### How? Updated 14 call sites across 6 documentation files to pass `'max'` as the second argument, which is the recommended default for stale-while-revalidate semantics: - `docs/01-app/02-guides/incremental-static-regeneration.mdx` - `docs/01-app/02-guides/redirecting.mdx` - `docs/01-app/02-guides/caching-without-cache-components.mdx` - `docs/01-app/02-guides/backend-for-frontend.mdx` - `docs/01-app/02-guides/how-revalidation-works.mdx` - `docs/01-app/03-api-reference/04-functions/cacheTag.mdx` The `revalidateTag.mdx` API reference page and `09-revalidating.mdx` getting started page were already updated. The `self-hosting.mdx` cache handler method signature (`async revalidateTag(tags)`) is unrelated and left unchanged.
Author
Parents
Loading