Skip to content

Commit

Permalink
Merge pull request #20 from endless-horses/fix#19-page-error
Browse files Browse the repository at this point in the history
배포 환경에서 발생하는 에러 해결 close #19
  • Loading branch information
jinlee1703 authored Jan 31, 2024
2 parents f476ae3 + a6bb75e commit 96f5bdf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ReportHandler } from 'web-vitals';

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);
});
}
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;

0 comments on commit 96f5bdf

Please sign in to comment.