From ca49e13863655deba5db20d838a4277c41c9bc88 Mon Sep 17 00:00:00 2001 From: murtuza syed Date: Wed, 11 Jan 2023 23:48:42 -0600 Subject: [PATCH] Fix: Infinite loop by passing empty array to useEffect --- src/Components/ProductTable.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/ProductTable.jsx b/src/Components/ProductTable.jsx index ea76621..2dfa707 100644 --- a/src/Components/ProductTable.jsx +++ b/src/Components/ProductTable.jsx @@ -41,7 +41,7 @@ export default function ProductTable({ cart, updateCart }) { setProducts(body); }; fetchProducts(); - }); + },[]); return (