diff --git a/src/App.tsx b/src/App.tsx index da43117..a28fb4d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,3 +1,5 @@ +import { useState } from "react"; + const products = [ { title: 'Cabbage', isFruit: false, id: 1 }, { title: 'Garlic', isFruit: false, id: 2 }, @@ -5,8 +7,14 @@ const products = [ ]; function App() { - const listItems = products.map(product => -
  • item.id !== id)) + } + + const list = items.map(product => +
  • remove(product.id)} key={product.id} className={product.isFruit ? 'text-green-200' : 'text-red-200'}> {product.title} @@ -16,7 +24,7 @@ function App() { return (

    Shopping list

    - +
    ) }