From 5c3ccf5d07c3f2082cd2c8852148d80c54a7f6b3 Mon Sep 17 00:00:00 2001 From: Papin Nikolai Date: Mon, 22 Apr 2024 15:40:31 +0300 Subject: [PATCH] Turns out I finished it --- app/frontend/src/App.js | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/app/frontend/src/App.js b/app/frontend/src/App.js index 3784575..1785e1a 100644 --- a/app/frontend/src/App.js +++ b/app/frontend/src/App.js @@ -1,25 +1,27 @@ -import logo from './logo.svg'; +// frontend/src/App.js +import { useState, useEffect } from 'react'; +import Form from 'react-bootstrap/Form'; import './App.css'; - + function App() { + const [todoItems, setTodoItems] = useState([]); + + useEffect(() => { + fetch('http://localhost:3010/api/todo-items') + .then((res) => res.json()) + .then((result) => setTodoItems(result.data)); + }, []); + return ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
+
+ {todoItems.map((item) => ( + + + + + ))}
); } - + export default App;