Unverified Commit e3aeb2f7 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Update code sample in performance measurement docs (#12690)

parent f0220e6a
...@@ -11,13 +11,16 @@ To measure any of the supported metrics, you will need to create a [custom ...@@ -11,13 +11,16 @@ To measure any of the supported metrics, you will need to create a [custom
App](/docs/advanced-features/custom-app.md) component and define a `reportWebVitals` function: App](/docs/advanced-features/custom-app.md) component and define a `reportWebVitals` function:
```js ```js
import App from 'next/app' // pages/_app.js
export default MyApp
export function reportWebVitals(metric) { export function reportWebVitals(metric) {
console.log(metric) console.log(metric)
} }
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp
``` ```
This function is fired when the final values for any of the metrics have finished calculating on This function is fired when the final values for any of the metrics have finished calculating on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment