-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
solution todoapp #977
Conversation
There was a problem hiding this 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 */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments
src/components/Footer.tsx
Outdated
import classNames from 'classnames'; | ||
|
||
export const Footer: React.FC = () => { | ||
const { todos, setFilterButton, setTodos, filterButton } = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split it in rows
src/components/Header.tsx
Outdated
import classNames from 'classnames'; | ||
|
||
export const Header: React.FC = () => { | ||
const { todos, setTodos, toDoTitle, setToDoTitle } = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
src/components/Header.tsx
Outdated
return; | ||
} | ||
|
||
setTodos([...todos, newTodo]); |
There was a problem hiding this comment.
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
(https://robsza1122.github.io/react_todo-app/