about summary refs log tree commit diff stats
path: root/src/reportWebVitals.js
diff options
context:
space:
mode:
authorredcreeper14385 <mounderfod@gmail.com>2021-11-18 15:54:04 +0000
committerredcreeper14385 <mounderfod@gmail.com>2021-11-18 15:54:04 +0000
commit328d355f83d395037e5453f5a10a2290b1975774 (patch)
tree0ad19c8b400be2aca2d145ad390deaf778adb243 /src/reportWebVitals.js
downloadfacere-cito-328d355f83d395037e5453f5a10a2290b1975774.tar.gz
Initialize project using Create React App
Diffstat (limited to 'src/reportWebVitals.js')
-rw-r--r--src/reportWebVitals.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/reportWebVitals.js b/src/reportWebVitals.js
new file mode 100644
index 0000000..5253d3a
--- /dev/null
+++ b/src/reportWebVitals.js
@@ -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;