From 407a123793a5aa5908b4bbf21b5830a90a60a0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przy=C5=82uski?= Date: Tue, 8 Oct 2024 12:26:22 +0200 Subject: [PATCH] refactor: extract variables from toggleMultipleTodosStatus in TodoContext --- src/components/Todos/Todos.tsx | 2 ++ src/components/context/TodoContext.tsx | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/components/Todos/Todos.tsx b/src/components/Todos/Todos.tsx index c858973b4..56cd464d1 100644 --- a/src/components/Todos/Todos.tsx +++ b/src/components/Todos/Todos.tsx @@ -6,6 +6,7 @@ export const Todos = () => { const [editingTodoId, setEditingTodoId] = useState(null); const [editingTitle, setEditingTitle] = useState(''); const renameInputRef = useRef(null); + const checkboxRef = useRef(null); const { toggleTodoStatus, updateTodoTitle, deleteTodo, filteredTodos } = useTodoContext(); @@ -70,6 +71,7 @@ export const Todos = () => { {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}