Skip to content

Commit a40de37

Browse files
committed
Merge pull request #18 from sapegin/patch-1
Components should extend Component class
2 parents f5cc73f + 216dcd2 commit a40de37

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function select(state) {
9191
};
9292
}
9393

94-
class CounterContainer {
94+
class CounterContainer extends Component {
9595
render() {
9696
// connect() call below will inject `dispatch` and
9797
// every key returned by `select` as props into our container:
@@ -145,7 +145,7 @@ function select(state) {
145145
};
146146
}
147147

148-
class CounterContainer {
148+
class CounterContainer extends Component {
149149
render() {
150150
const { dispatch, counter } = this.props;
151151

@@ -172,9 +172,10 @@ Finally, how do we actually hook it up to a Redux store? We need to create the s
172172
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.
173173

174174
```js
175+
import { Component } from 'react';
175176
import { Provider } from 'react-redux';
176177

177-
class App {
178+
class App extends Component {
178179
render() {
179180
// ...
180181
}

0 commit comments

Comments
 (0)