Skip to content

Adding todo#13

Open
ratelChief wants to merge 14 commits into
masterfrom
adding-todo
Open

Adding todo#13
ratelChief wants to merge 14 commits into
masterfrom
adding-todo

Conversation

@ratelChief
Copy link
Copy Markdown
Owner

Так?

Comment thread src/components/todoList/TodoList.jsx Outdated

render() {
const { todoList, removeTodo } = this.props;
const btnAdd = <button onClick={this.onAddBtn}>+</button>;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Такое лучше выносить в методы класса, либо в отдельый компонент

Comment thread src/components/todoList/TodoList.jsx Outdated
const { todoList, removeTodo } = this.props;
const btnAdd = <button onClick={this.onAddBtn}>+</button>;

const renderItem = todoList.map(item =>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

аналогично, лучше вынести в отдельный метод

Comment thread src/reducers/todoReducer.js Outdated
} from '../utils.js';

const initialState = {
todoList: getFromLocalStorage(TODOLIST)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Если два разных слово, то в коснтантах пишут через _ -> TODO_LIST

Comment thread src/components/todoList/TodoList.jsx Outdated

return (
<div>
<input onChange={this.onInputChange} type='text' /> {btnAdd}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

в инпут надо value записывать из стейта

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