diff --git a/graph-tutorial/package.json b/graph-tutorial/package.json index f3388ae..bd1fb32 100644 --- a/graph-tutorial/package.json +++ b/graph-tutorial/package.json @@ -15,7 +15,7 @@ "react-dom": "^18.3.1", "react-router-dom": "^6.26.1", "react-scripts": "5.0.1", - "web-vitals": "^3.5.2", + "web-vitals": "4.2.4", "windows-iana": "^5.1.0" }, "scripts": { diff --git a/graph-tutorial/src/reportWebVitals.ts b/graph-tutorial/src/reportWebVitals.ts index 49a2a16..af13188 100644 --- a/graph-tutorial/src/reportWebVitals.ts +++ b/graph-tutorial/src/reportWebVitals.ts @@ -1,13 +1,13 @@ -import { ReportHandler } from 'web-vitals'; +import { MetricType } from 'web-vitals'; -const reportWebVitals = (onPerfEntry?: ReportHandler) => { +const reportWebVitals = (onPerfEntry?: (metric: MetricType) => void) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); + import('web-vitals').then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => { + onCLS(onPerfEntry); + onINP(onPerfEntry); + onFCP(onPerfEntry); + onLCP(onPerfEntry); + onTTFB(onPerfEntry); }); } }; diff --git a/graph-tutorial/yarn.lock b/graph-tutorial/yarn.lock index f0415de..84b31f4 100644 --- a/graph-tutorial/yarn.lock +++ b/graph-tutorial/yarn.lock @@ -9584,10 +9584,10 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -web-vitals@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-3.5.2.tgz#5bb58461bbc173c3f00c2ddff8bfe6e680999ca9" - integrity sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg== +web-vitals@4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7" + integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw== webidl-conversions@^4.0.2: version "4.0.2"