From dae3d37886bebe174fe7734e94f8f427b5c7b3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= Date: Fri, 18 Nov 2022 11:00:59 +0100 Subject: [PATCH] Update web-vitals calls The `getXXX()` functions of the `web-vitals` library were renamed in 3.0.0 to `onXXX()` [1]. Fix our calls to reflect this. [1]: https://github.com/GoogleChrome/web-vitals/pull/222 --- src/reportWebVitals.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/reportWebVitals.ts b/src/reportWebVitals.ts index c96ca2e6..86f04a92 100644 --- a/src/reportWebVitals.ts +++ b/src/reportWebVitals.ts @@ -2,12 +2,12 @@ import { ReportHandler } from 'web-vitals'; export const reportWebVitals = (onPerfEntry?: ReportHandler) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); + import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => { + onCLS(onPerfEntry); + onFID(onPerfEntry); + onFCP(onPerfEntry); + onLCP(onPerfEntry); + onTTFB(onPerfEntry); }); } };