October 2019
Intermediate to advanced
426 pages
11h 49m
English
Now that we have passed on the removeTodo and toggleTodo methods as props to the TodoItem component, we can implement these features there.
Let's make the TodoItem component dynamic now:
handleToggle () { const { toggleTodo, id } = this.props toggleTodo(id) } handleRemove () { const { removeTodo, id } = this.props removeTodo(id) }
render () { const { title, completed } = this.props return ( <div style={{ width: 400, height: 25 }}> <input type="checkbox" checked={completed} onChange={this.handleToggle} /> {title} <button ...Read now
Unlock full access