File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -89,20 +89,16 @@ const store = createStore(rootReducer);
8989
9090// view layer
9191
92- function TodoApp ( { todos, onToggleTodo } ) {
93- return < TodoList
94- todos = { todos }
95- onToggleTodo = { onToggleTodo }
96- /> ;
92+ function TodoApp ( ) {
93+ return < ConnectedTodoList /> ;
9794}
9895
99- function TodoList ( { todos, onToggleTodo } ) {
96+ function TodoList ( { todos } ) {
10097 return (
10198 < div >
102- { todos . map ( todo => < TodoItem
99+ { todos . map ( todo => < ConnectedTodoItem
103100 key = { todo . id }
104101 todo = { todo }
105- onToggleTodo = { onToggleTodo }
106102 /> ) }
107103 </ div >
108104 ) ;
@@ -135,11 +131,12 @@ function mapDispatchToProps(dispatch) {
135131 } ;
136132}
137133
138- const ConnectedTodoApp = connect ( mapStateToProps , mapDispatchToProps ) ( TodoApp ) ;
134+ const ConnectedTodoList = connect ( mapStateToProps ) ( TodoList ) ;
135+ const ConnectedTodoItem = connect ( null , mapDispatchToProps ) ( TodoItem ) ;
139136
140137ReactDOM . render (
141138 < Provider store = { store } >
142- < ConnectedTodoApp />
139+ < TodoApp />
143140 </ Provider > ,
144141 document . getElementById ( 'root' )
145142) ;
You can’t perform that action at this time.
0 commit comments