@@ -18,22 +18,22 @@ On client:
1818``` javascript
1919import React from ' react' ;
2020import ReactDOM from ' react-dom' ;
21- import { Router } from ' react-router-async' ;
21+ import { BrowserRouter } from ' react-router-async' ;
2222import { routes , hooks } from ' ./common' ;
2323import createHistory from ' history/createBrowserHistory' ;
2424
2525const history = createHistory ();
2626const 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
3333On server (for example as express middleware):
3434``` javascript
3535export 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