mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
made Exercise 2.7 actually boot up
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user