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// components
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 ) ;
@@ -137,11 +133,12 @@ function mapDispatchToProps(dispatch) {
137133 } ;
138134}
139135
140- const ConnectedTodoApp = connect ( mapStateToProps , mapDispatchToProps ) ( TodoApp ) ;
136+ const ConnectedTodoList = connect ( mapStateToProps ) ( TodoList ) ;
137+ const ConnectedTodoItem = connect ( null , mapDispatchToProps ) ( TodoItem ) ;
141138
142139ReactDOM . render (
143140 < Provider store = { store } >
144- < ConnectedTodoApp />
141+ < TodoApp />
145142 </ Provider > ,
146143 document . getElementById ( 'root' )
147144) ;
You can’t perform that action at this time.
0 commit comments