made Exercise 2.7 actually boot up

This commit is contained in:
Ken
2019-02-28 22:49:41 -08:00
parent 800f621dfb
commit 129dd3c74b
5 changed files with 14 additions and 6 deletions

View File

@@ -10,7 +10,8 @@ interface TodoFooterProps {
}
const TodoFooter = (props: TodoFooterProps) => {
const itemCount = Object.keys(props.todos).filter(id => !props.todos[id].completed).length;
const { todos } = props;
const itemCount = todos ? Object.keys(todos).filter(id => !props.todos[id].completed).length : 0;
return (
<Stack horizontal horizontalAlign="space-between">