diff --git a/src/components/TodoFilter/TodoFilter.tsx b/src/components/TodoFilter/TodoFilter.tsx index 4fbf31281..9a9ca8c0a 100644 --- a/src/components/TodoFilter/TodoFilter.tsx +++ b/src/components/TodoFilter/TodoFilter.tsx @@ -16,6 +16,10 @@ export const TodoFilter: React.FC = () => { dispatch(setQuery(value.target.value)); }; + const resetQuery = () => { + dispatch(setQuery('')); + }; + return (

@@ -48,7 +52,7 @@ export const TodoFilter: React.FC = () => { data-cy="clearSearchButton" type="button" className="delete" - onClick={() => dispatch(setQuery(''))} + onClick={resetQuery} /> )} diff --git a/src/components/TodoList/TodoList.tsx b/src/components/TodoList/TodoList.tsx index 89e6be47f..7931ae90d 100644 --- a/src/components/TodoList/TodoList.tsx +++ b/src/components/TodoList/TodoList.tsx @@ -69,6 +69,7 @@ export const TodoList: React.FC = () => { {visibleTodos.map(todo => (