Skip to content

Commit e04b21e

Browse files
authored
Merge pull request #2 from RNGesus/main
fix: replace deprecated web-vitals APIs
2 parents 5427e7a + fa7c660 commit e04b21e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

templates/base/src/reportWebVitals.ts.ejs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
const reportWebVitals = (onPerfEntry?: () => void) => {
33
if (onPerfEntry && onPerfEntry instanceof Function) {
44
import("web-vitals").then(
5-
({ getCLS, getFID, getFCP, getLCP, getTTFB }: any) => {
6-
getCLS(onPerfEntry);
7-
getFID(onPerfEntry);
8-
getFCP(onPerfEntry);
9-
getLCP(onPerfEntry);
10-
getTTFB(onPerfEntry);
5+
({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {
6+
onCLS(onPerfEntry);
7+
onINP(onPerfEntry);
8+
onFCP(onPerfEntry);
9+
onLCP(onPerfEntry);
10+
onTTFB(onPerfEntry);
1111
}
1212
);
1313
}
1414
};
1515
<% } else { %>
1616
const reportWebVitals = onPerfEntry => {
1717
if (onPerfEntry && onPerfEntry instanceof Function) {
18-
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
19-
getCLS(onPerfEntry);
20-
getFID(onPerfEntry);
21-
getFCP(onPerfEntry);
22-
getLCP(onPerfEntry);
23-
getTTFB(onPerfEntry);
18+
import('web-vitals').then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {
19+
onCLS(onPerfEntry);
20+
onINP(onPerfEntry);
21+
onFCP(onPerfEntry);
22+
onLCP(onPerfEntry);
23+
onTTFB(onPerfEntry);
2424
});
2525
}
2626
};

0 commit comments

Comments
 (0)