Skip to content

Commit

Permalink
update applyMiddleware.md to React 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
omnidan committed Oct 15, 2015
1 parent 460a4dc commit e75a26e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/api/applyMiddleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ function makeSandwichesForEverybody() {
// This is very useful for server side rendering, because I can wait
// until data is available, then synchronously render the app.

import { renderToString } from 'react-dom/server';

store.dispatch(
makeSandwichesForEverybody()
).then(() =>
response.send(React.renderToString(<MyApp store={store} />))
response.send(renderToString(<MyApp store={store} />))
);

// I can also dispatch a thunk async action from a component
Expand Down

0 comments on commit e75a26e

Please sign in to comment.