Skip to content

Commit 1432aac

Browse files
committed
update ReadMe to current API
1 parent 4dfd6ff commit 1432aac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ import createHistory from 'history/createBrowserHistory';
2525
const history = createHistory();
2626
const mountNode = document.getElementById('app');
2727

28-
Router.init({ path: history.location.pathname, routes, hooks }).then(({ Router, Component, router, callback }) => {
29-
ReactDOM.render(<Router {...{ Component, router, history }} />, mountNode, callback);
28+
Router.init({ path: history.location.pathname, routes, hooks, history }).then(({ Router, routerProps, Component, componentProps, callback }) => {
29+
ReactDOM.render(<Router {...routerProps} />, mountNode, callback);
3030
}).catch(error => console.log(error));
3131
```
3232

3333
On server (for example as express middleware):
3434
```javascript
3535
export default function (req, res, next) {
36-
Router.init({ path: req.path, routes, hooks }).then(({ Component, status, redirect }) => {
36+
Router.init({ path: req.path, routes, hooks }).then(({ Router, routerProps, status, redirect }) => {
3737
if (redirect) {
3838
res.redirect(status, redirect);
3939
} else {
4040
const html = ReactDOM.renderToStaticMarkup(HtmlComponent({
41-
markup: ReactDOM.renderToString(<Component />),
41+
markup: ReactDOM.renderToString(<Router {...routerProps} />),
4242
assets: assets
4343
}));
4444
res.status(status).send('<!DOCTYPE html>' + html);

0 commit comments

Comments
 (0)