From 8cc72afd7bcf4cc0a74b2752f8ddc645eabe3c90 Mon Sep 17 00:00:00 2001 From: Laktionov Anton Date: Thu, 28 May 2026 19:16:14 +0300 Subject: [PATCH] final --- src/App.jsx | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index a7c87c7..80ecd56 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,21 +1,32 @@ import React, { useMemo, useCallback, useState } from 'react' -const Button = React.memo(({ onClick }) => { - console.log('Button rendred'); - return +const TodoItem = React.memo(({ item, onToggle, onDelete }) => { + console.log(`rendred ${item.id}`); + return
  • + {item.name} + + +
  • }) -function Parent() { - const [count,setCount] = useState(0); - - const handlerClick = useCallback(()=>{ - setCount(prev => prev + 1); +function ItemList({ items }) { + + const handleToggle = useCallback(id => { + items.done = true; + console.log(`Item ${id} done`) + console.log(id) },[]); + const handleDelete = useCallback(id => { + items.pop(id); + },[]); return ( <> -

    Counter: {count}

    -