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

solution todoapp #977

Closed
wants to merge 9 commits into from
Closed

solution todoapp #977

wants to merge 9 commits into from

Conversation

robsza1122
Copy link

Copy link

@BogdanMaliuta BogdanMaliuta left a comment

Choose a reason for hiding this comment

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

Nice!
But because of not using func setState can`t approve

src/App.tsx Outdated
<Header />
<ToDoList />
<Footer />
{/* Hide the footer if there are no todos */}

Choose a reason for hiding this comment

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

remove comments

import classNames from 'classnames';

export const Footer: React.FC = () => {
const { todos, setFilterButton, setTodos, filterButton } =

Choose a reason for hiding this comment

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

split it in rows

import classNames from 'classnames';

export const Header: React.FC = () => {
const { todos, setTodos, toDoTitle, setToDoTitle } =

Choose a reason for hiding this comment

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

same here

return;
}

setTodos([...todos, newTodo]);

Choose a reason for hiding this comment

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

everywhere if you want to update your state based on prev state use functional setState

@robsza1122 robsza1122 closed this Jul 1, 2024
@robsza1122 robsza1122 deleted the solution branch July 1, 2024 14:53
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