Skip to content

Commit e28237c

Browse files
committed
Update README.md
1 parent 62f0b0a commit e28237c

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,39 @@ export default class Counter {
198198

199199
#### The root component
200200

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.
202202

203203
```js
204204
import React from 'react';
205205
import { dispatch } from 'redux';
206206
import * as stores from './stores/index';
207207

208-
// Let it know about all the stores
208+
// Register stores with the dispatcher (and initialize their state)
209209
@dispatch(stores)
210210
export default class App {
211211
/* ... */
212212
}
213213
```
214214

215+
```js
216+
// Without decorators:
217+
import React from 'react';
218+
import { Dispatcher } from 'redux';
219+
import * as stores from './stores/index';
220+
221+
export default class App {
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! */}
226+
{() => <SomeRootComponent />}
227+
</Dispatcher>
228+
);
229+
}
230+
}
231+
232+
```
233+
215234
## FAQ
216235

217236
### How does hot reloading work?

0 commit comments

Comments
 (0)