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

Allow route override in reportWebVitals, bump version #127

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

bahlo
Copy link
Member

@bahlo bahlo commented Jun 27, 2023

This adds an optional path parameter to a new reportWebVitalsWithPath function allowing people to specify their own value (e.g. falling back to window.location.pathname.

Here's an example for people that want the actual path (not the next path):

import { NextWebVitalsMetric } from 'next/app'
import { reportWebVitalsWithPath } from 'next-axiom'

export function reportWebVitals(metric: NextWebVitalsMetric) {
  reportWebVitalsWithPath(metric, window.location.pathname)
}

This also bumps the version to 0.18.

@vercel
Copy link

vercel bot commented Jun 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-axiom-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 2:08pm

@bahlo bahlo force-pushed the arne/allow-route-override branch from 012366e to a72c12e Compare June 27, 2023 14:01
@bahlo bahlo changed the title Allow route override in reportWebVitals Allow route override in reportWebVitals, bump version Jun 27, 2023
src/index.ts Show resolved Hide resolved
@bahlo bahlo merged commit e6648d2 into main Jun 27, 2023
8 checks passed
@bahlo bahlo deleted the arne/allow-route-override branch June 27, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants