18 likes
·
115 reads
7 comments
Hi, great article! When you get part two can you edit this article to link to it?
It's linked from the part 2
the circle is complete :)
Thanks for another great tutorial, hopefully I'll be able to use what I learned soon in a real app :) A few comments/questions.
- You said there's no need to change the singleTodo file, but I think you do need to, in the bindings of the functions, Let's take for example the removeTodo method: you need to change from just a regular binding (onClick={this.removeTodo}) to something like (onClick={() => this.removeTodo(todoId)}. Worked for me only after the change.
- My visibility filter isn't working. I think it's because the render function of the todoApp isn't called again and thus the required changed aren't happening. How would you fix that?
Thanks again!
Thanks for your ever kind words, @chiptus! :)
You’re right, if you’re coming straight from the ES6+React getting started tutorial, the change you describe is needed. I've refactored the code in the original ES6+React example (check it out here), and it is in this context, I said you don’t need any change. Thanks for noticing this, I'll update the ES6+React tutorial soon.
I’m afraid I don’t exactly follow the cause of your bug; if you could let me peek into your code/repo, I would be better able to figure out the root of the problem. Alternatively, here is the repo ('redux' branch) with everything perfectly working. Maybe you can compare your version to it, and figure out what the problem is?
Hope this helps! :)
Hello, I'm struggling with choose redux and mobx and for now I'm reading your article. IMO there is a bug in your example code:
case actionTypes.COMPLETE_TODO: return state.map(todo => { if (todo.id === action.todoId) { return Object.assign({}, todo, {isDone: !todo.isDone}) } return todo });
This action could mark ToDo item as not completed as well. Action type should be called "Toggle" or explicit use "true": {isDone:true}