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' #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aleksandrovfe
Copy link

Copy link
Contributor

@vpolets vpolets left a comment

Choose a reason for hiding this comment

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

Ну так як я вчора з тоюою над цим сидів, то мені подобається, я приймаю, тільки зверни увагу на коментарі. Молодець!

import PropTypes from 'prop-types';

const Todo = ({ todo, toggle, destroyTodo }) => {
const completedStyle = {
Copy link
Contributor

Choose a reason for hiding this comment

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

ну бажано виноси це в файл стилів

handleDestroyAllCompletedTodos = () => {
this.setState(prevState => ({
visibleTodos: prevState.visibleTodos
.filter(todo => todo.completed === false),
Copy link
Contributor

Choose a reason for hiding this comment

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

не треба повторювати ту ж дію два рази обчислюй один раз і передавай вже змінну

this.setState(prevState => {
  const result = prevState.visibleTodos
        .filter(todo => todo.completed === false);

  return {
    visibleTodos: result,
    filteredTodos: result,
    }
});

}

handleDestroyTodo = (id) => {
const updatedTodo = this.state.visibleTodos;
Copy link
Contributor

Choose a reason for hiding this comment

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

це не копія

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