Skip to content

Commit

Permalink
reportWebVitals
Browse files Browse the repository at this point in the history
  • Loading branch information
OlhaDanylevska committed Jan 29, 2024
1 parent 4b644d2 commit 29f3afb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import reportWebVitals from "./reportWebVitals"

ReactDOM.render(
<React.StrictMode>
Expand Down
13 changes: 13 additions & 0 deletions client/src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const reportWebVitals = (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 29f3afb

Please sign in to comment.