Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Fix: Correct cacheTag Function Usage #71912

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

wiscaksono
Copy link
Contributor

What?

Documentation Fix: Correct cacheTag Function Usage

Issue: The current documentation incorrectly states that cacheTag accepts an array of tags. However, the source code implementation uses rest parameters (...tags: string[]), expecting individual string arguments rather than an array.

Changes:
Updated the "Notes" section to reflect the function's correct usage:

Why?

This change:

  1. Aligns with the actual implementation in the source code
  2. Prevents TypeScript errors when users follow the documentation
  3. Provides clearer guidance on using the function with both direct arguments and arrays (using the spread operator)

The current documentation might lead developers to encounter the TypeScript error:

"Argument of type 'string[]' is not assignable to parameter of type 'string'"

Related

Fixes #71901

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Oct 27, 2024
@ijjk
Copy link
Member

ijjk commented Oct 27, 2024

Allow CI Workflow Run

  • approve CI run for commit: 9c593e4

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot pass an array of tags to cacheTag function
2 participants