Skip to content

Commit 1b83191

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 59340c5 + ea051dc commit 1b83191

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ On client:
1818
```javascript
1919
import React from 'react';
2020
import ReactDOM from 'react-dom';
21-
import { Router } from 'react-router-async';
21+
import { BrowserRouter } from 'react-router-async';
2222
import { routes, hooks } from './common';
2323
import createHistory from 'history/createBrowserHistory';
2424

2525
const history = createHistory();
2626
const mountNode = document.getElementById('app');
2727

28-
Router.init({ path: history.location.pathname, routes, hooks, history }).then(({ Router, routerProps, Component, componentProps, callback }) => {
28+
BrowserRouter.init({ path: history.location.pathname, routes, hooks, history }).then(({ Router, routerProps, Component, componentProps, callback }) => {
2929
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(({ Router, routerProps, status, redirect }) => {
36+
ServerRouter.init({ path: req.path, routes, hooks }).then(({ Router, routerProps, status, redirect }) => {
3737
if (redirect) {
3838
res.redirect(status, redirect);
3939
} else {

0 commit comments

Comments
 (0)