Initialize project using Create React App

This commit is contained in:
Sudhanshu Gautam 2021-01-09 12:52:47 +05:30
parent 9c7f91a537
commit d5c4ea592a
17 changed files with 3006 additions and 2346 deletions

15
src/reportWebVitals.ts Normal file
View file

@ -0,0 +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);
});
}
};
export default reportWebVitals;