You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,16 +63,16 @@ It is advisable that only top-level components of your app (such as route handle
63
63
64
64
### “Dumb” component is unaware of Redux
65
65
66
-
Let’s say we have a `<Counter />` “dumb” component with a number `counter` prop, and an `increment` function prop that it will call when user presses an “Increment” button:
66
+
Let’s say we have a `<Counter />` “dumb” component with a number `value` prop, and an `onIncrement` function prop that it will call when user presses an “Increment” button:
67
67
68
68
```js
69
69
import { Component } from'react';
70
70
71
71
exportdefaultclassCounterextendsComponent {
72
72
render() {
73
73
return (
74
-
<button onClick={this.props.increment}>
75
-
{this.props.counter}
74
+
<button onClick={this.props.onIncrement}>
75
+
{this.props.value}
76
76
</button>
77
77
);
78
78
}
@@ -97,14 +97,14 @@ import { increment } from '../actionsCreators';
97
97
// Which part of the Redux global state does our component want to receive as props?
98
98
functionmapState(state) {
99
99
return {
100
-
counter:state.counter
100
+
value:state.counter
101
101
};
102
102
}
103
103
104
104
// Which action creators does it want to receive by props?
0 commit comments