Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1731

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Develop #1731

wants to merge 3 commits into from

Conversation

djtyrf312
Copy link

Comment on lines +88 to +93
handleFilterSelect(
todos,
FilterOptions.Completed,
onFilterSelect,
setIsSelected,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this piece of code is often repeated, however only one prop differs.
Also, 2 of the props are taken from the parent component as a prop, it means that it can be simplified. Do we need to expect todos and onFilterSelect in the function?

<button
type="button"
className={classNames('todoapp__toggle-all', {
active: verifyActiveTodos(todos),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say we don't need a function for that since it is only used once

todos: Todo[];
};

export const Header: FC<Props> = ({ todos }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can return right away since there's no component logic inside

Comment on lines +9 to +11
export const TodoList: FC<Props> = ({ todos }) => {
return (
<section className="todoapp__main" data-cy="TodoList">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return statement is not necessary here, we can return right away by wrapping component result in the round braces instead of the curly ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants