From ca519f47b13cc5042da9fbd71ca450eeb6b092fd Mon Sep 17 00:00:00 2001 From: isHardCoded Date: Wed, 25 Jun 2025 15:38:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=B0=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=BD=D1=83?= =?UTF-8?q?=D1=8E=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8E=20getProduc?= =?UTF-8?q?ts=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B4=D1=83=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D1=81=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/App.jsx b/src/App.jsx index c144e38..764350f 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -68,6 +68,20 @@ function Product() { } function App() { + const [products, setProducts] = React.useState([]) + + const getProducts = async () => { + const response = await fetch('http://localhost:8000/products') + const data = await response.json() + setProducts(data) + } + + React.useEffect(() => { + getProducts() + }, []) + + console.log(products) + return ( <>