Skip to content

Commit 7bffbfc

Browse files
committed
Fixed problem caused by upgrading web vitals
1 parent 3a25556 commit 7bffbfc

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/reportWebVitals.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { ReportHandler } from 'web-vitals';
2-
3-
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
1+
const reportWebVitals = (onPerfEntry?: (metric: any) => void) => {
42
if (onPerfEntry && onPerfEntry instanceof Function) {
5-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6-
getCLS(onPerfEntry);
7-
getFID(onPerfEntry);
8-
getFCP(onPerfEntry);
9-
getLCP(onPerfEntry);
10-
getTTFB(onPerfEntry);
3+
import('web-vitals').then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {
4+
onCLS(onPerfEntry);
5+
onINP(onPerfEntry);
6+
onFCP(onPerfEntry);
7+
onLCP(onPerfEntry);
8+
onTTFB(onPerfEntry);
119
});
1210
}
1311
};

0 commit comments

Comments
 (0)