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
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ function select(state) {
91
91
};
92
92
}
93
93
94
-
classCounterContainer {
94
+
classCounterContainerextendsComponent{
95
95
render() {
96
96
// connect() call below will inject `dispatch` and
97
97
// every key returned by `select` as props into our container:
@@ -145,7 +145,7 @@ function select(state) {
145
145
};
146
146
}
147
147
148
-
classCounterContainer {
148
+
classCounterContainerextendsComponent{
149
149
render() {
150
150
const { dispatch, counter } =this.props;
151
151
@@ -172,9 +172,10 @@ Finally, how do we actually hook it up to a Redux store? We need to create the s
172
172
The trick is to wrap the whole view hierarchy into `<Provider>{() => ... }</Provider>` where `Provider` is imported from `react-redux`. One gotcha is that **the child of `Provider` must be a function**. This is to work around an issue with how context (undocumented feature we have to rely on to pass Redux data to components below) works in React 0.13. In React 0.14, you will be able to put your view hierarchy in `<Provider>` without wrapping it into a function.
0 commit comments