Merge pull request #81 from arthurdenner/patch-1

Fix convert undefined to object in step 1-6
This commit is contained in:
David Zearing
2019-03-04 11:13:04 -08:00
committed by GitHub

View File

@@ -3,7 +3,7 @@ import { TodoListItem } from './TodoListItem';
export class TodoList extends React.Component<any, any> {
render() {
const { filter, todos } = this.props;
const { filter, todos = {} } = this.props;
// filteredTodos returns an array of filtered todo keys [01,02,03]
const filteredTodos = Object.keys(todos).filter(id => {