Created
August 19, 2021 15:20
-
-
Save apeli23/9890e7fcc5c65175aabb38365fb4db51 to your computer and use it in GitHub Desktop.
react report web vitals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reportWebVitals = onPerfEntry => { | |
if (onPerfEntry && onPerfEntry instanceof Function) { | |
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { | |
getCLS(onPerfEntry); | |
getFID(onPerfEntry); | |
getFCP(onPerfEntry); | |
getLCP(onPerfEntry); | |
getTTFB(onPerfEntry); | |
}); | |
} | |
}; | |
export default reportWebVitals; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment