Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e3aeb2f7
Unverified
Commit
e3aeb2f7
authored
May 11, 2020
by
Tim Neutkens
Committed by
GitHub
May 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code sample in performance measurement docs (#12690)
parent
f0220e6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
measuring-performance.md
docs/advanced-features/measuring-performance.md
+7
-4
No files found.
docs/advanced-features/measuring-performance.md
View file @
e3aeb2f7
...
...
@@ -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:
```
js
import
App
from
'next/app'
export
default
MyApp
// pages/_app.js
export
function
reportWebVitals
(
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment