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
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -198,20 +198,39 @@ export default class Counter {
198
198
199
199
#### The root component
200
200
201
-
Decorate your top-level component with `@dispatch(stores)` (or `<Dispatcher stores={stores}>` inside) to bind it to a Redux dispatcher instance.
201
+
Decorate your top-level component with `@dispatch(stores)` (or put `<Dispatcher stores={stores}>` inside it) to bind it to a Redux dispatcher instance.
202
202
203
203
```js
204
204
importReactfrom'react';
205
205
import { dispatch } from'redux';
206
206
import*asstoresfrom'./stores/index';
207
207
208
-
//Let it know about all the stores
208
+
//Register stores with the dispatcher (and initialize their state)
209
209
@dispatch(stores)
210
210
exportdefaultclassApp {
211
211
/* ... */
212
212
}
213
213
```
214
214
215
+
```js
216
+
// Without decorators:
217
+
importReactfrom'react';
218
+
import { Dispatcher } from'redux';
219
+
import*asstoresfrom'./stores/index';
220
+
221
+
exportdefaultclassApp {
222
+
render() {
223
+
return (
224
+
<Dispatcher stores={stores}>
225
+
{/* Yes this is a function as a child. We won't need this when React 0.14 comes out! */}
0 commit comments