Joan León PRO
⚡️ Web Performance Consultant | Speaker | Staff Frontend Engineer at @AdevintaSpain | @GoogleDevExpert in #WebPerf | @cloudinary Ambassador
Lab
Field
Loading
Visual Stability
Lab
Field
Visual Stability
Lab
Field
Field
Interactivity
Interactivity
Lab
Field
Interactivity
Lab
Field
WEBSITES 8.36M
DATA 43.88 TB
import WebVitalsReporter from '@s-ui/react-web-vitals'
export default function App() {
const handleReport = metric => {
console.log(metric) // do something
}
return (
<WebVitalsReporter onReport={handleReport}>
<main />
</WebVitalsReporter>
)
}
<script>
(function () {
var script = document.createElement('script');
script.src = 'https://unpkg.com/web-vitals@3/dist/web-vitals.iife.js';
script.onload = function () {
// When loading `web-vitals` using a classic script, all the public
// methods can be found on the `webVitals` global namespace.
webVitals.onCLS(console.log);
webVitals.onFID(console.log);
webVitals.onLCP(console.log);
};
document.head.appendChild(script);
})();
</script>
import {
onFCP,
onLCP,
onCLS
} from 'web-vitals'
onFCP(({value}) => console.log('FCP: ', value), {reportSoftNavs: true});
onLCP(({value}) => console.log('LCP: ', value), {reportSoftNavs: true});
onCLS(({value}) => console.log('CLS: ', value), {reportSoftNavs: true});
By Joan León
Discover how to improve user experience and search engine ranking by understanding Core Web Vitals. Learn how to measure and improve them, as well as other important metrics. Presented by @nucliweb.