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

docs: update WebVitals component #73869

Merged
merged 3 commits into from
Dec 13, 2024
Merged

docs: update WebVitals component #73869

merged 3 commits into from
Dec 13, 2024

Conversation

abdonrd
Copy link
Contributor

@abdonrd abdonrd commented Dec 12, 2024

What?

Update WebVitals component.

Why?

In the useReportWebVitals documentation:
https://nextjs.org/docs/app/api-reference/functions/use-report-web-vitals

Screenshot 2024-12-12 at 4 35 27 PM

If you do it in a TypeScript project, you have this error:

Screenshot 2024-12-12 at 3 49 07 PM
'WebVitals' cannot be used as a JSX component.
  Its type '() => void' is not a valid JSX element type.
    Type '() => void' is not assignable to type '(props: any, deprecatedLegacyContext?: any) => ReactNode'.
      Type 'void' is not assignable to type 'ReactNode'.ts(2786)

How?

Returning null solves the problem.

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

ijjk commented Dec 12, 2024

Allow CI Workflow Run

  • approve CI run for commit: 23e5ed8

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

1 similar comment
@ijjk
Copy link
Member

ijjk commented Dec 12, 2024

Allow CI Workflow Run

  • approve CI run for commit: 23e5ed8

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

@ijjk
Copy link
Member

ijjk commented Dec 12, 2024

Allow CI Workflow Run

  • approve CI run for commit: d165d02

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

@ijjk ijjk enabled auto-merge (squash) December 13, 2024 21:44
@ijjk ijjk merged commit 75c1cd0 into vercel:canary Dec 13, 2024
39 checks passed
@abdonrd abdonrd deleted the patch-1 branch December 13, 2024 22:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Related to Next.js' official documentation. locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants