Skip to content

Commit ef299d4

Browse files
authored
Merge pull request mocheng#9 from tsq/patch-1
Update to smart_dumb mode
2 parents 0cbf606 + 4fd6401 commit ef299d4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

chapter-03/redux_smart_dumb/src/views/Summary.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import store from '../Store.js';
44

55
class Summary extends Component {
66
render() {
7-
const sum = this.state.sum;
87
return (
9-
<div>Total Count: {sum}</div>
8+
<div>Total Count: {this.props.sum}</div>
109
);
1110
}
1211
}
@@ -54,13 +53,10 @@ class SummaryContainer extends Component {
5453
}
5554

5655
render() {
57-
const sum = this.state.sum;
5856
return (
59-
<div>Total Count: {sum}</div>
57+
<Summary sum={this.state.sum}></Summary>
6058
);
6159
}
6260
}
6361

6462
export default SummaryContainer;
65-
66-

0 commit comments

Comments
 (0)