integrating immer

This commit is contained in:
Ken
2019-01-30 14:33:48 -08:00
parent a61d89ea14
commit c44af2a38f
7 changed files with 82 additions and 31 deletions

View File

@@ -8,18 +8,21 @@ import { TodoItem, FilterTypes } from '../store';
export interface TodoAppProps {
todos: { [id: string]: TodoItem };
filter: FilterTypes;
add: (label: string) => void;
remove: (id: string) => void;
setFilter: (filter: FilterTypes) => void;
}
export class TodoApp extends React.Component<TodoAppProps> {
render() {
const { todos, filter } = this.props;
const { todos, filter, add, remove, setFilter } = this.props;
return (
<Stack horizontalAlign="center">
<Stack style={{ width: 650 }} verticalGap={25}>
<TodoHeader />
<TodoHeader {...{ add, remove, filter }} />
<TodoList {...{ todos, filter }} />
<TodoFooter />
<TodoFooter {...{ todos, setFilter }} />
</Stack>
</Stack>
);