1
0
Fork 0

testing lists

This commit is contained in:
Henrik Hautakoski 2025-11-13 21:42:58 +01:00
parent 02c9680231
commit 24001910ef

View file

@ -1,9 +1,20 @@
const welcome = "Hello there!"
const products = [
{ title: 'Cabbage', id: 1 },
{ title: 'Garlic', id: 2 },
{ title: 'Apple', id: 3 },
];
function App() {
const listItems = products.map(product =>
<li key={product.id}>
{product.title}
</li>
);
return (
<div className="mx-auto flex flex-col items-center space-y-4 text-white">
<p className="text-3xl">{welcome}</p>
<h1 className="text-2xl">Shopping list</h1>
<ul className="list-disc">{listItems}</ul>
</div>
)
}