-
Notifications
You must be signed in to change notification settings - Fork 1
Adding todo #13
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
base: master
Are you sure you want to change the base?
Adding todo #13
Conversation
item or item.id as data to removeTodo
from todoList from localStorage
src/components/todoList/TodoList.jsx
Outdated
|
||
render() { | ||
const { todoList, removeTodo } = this.props; | ||
const btnAdd = <button onClick={this.onAddBtn}>+</button>; |
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.
Такое лучше выносить в методы класса, либо в отдельый компонент
src/components/todoList/TodoList.jsx
Outdated
const { todoList, removeTodo } = this.props; | ||
const btnAdd = <button onClick={this.onAddBtn}>+</button>; | ||
|
||
const renderItem = todoList.map(item => |
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.
аналогично, лучше вынести в отдельный метод
src/reducers/todoReducer.js
Outdated
} from '../utils.js'; | ||
|
||
const initialState = { | ||
todoList: getFromLocalStorage(TODOLIST) |
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.
Если два разных слово, то в коснтантах пишут через _
-> TODO_LIST
src/components/todoList/TodoList.jsx
Outdated
|
||
return ( | ||
<div> | ||
<input onChange={this.onInputChange} type='text' /> {btnAdd} |
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.
в инпут надо value записывать из стейта
Так?