Connected-react-router: Doesn't support "basename" prop correct

Created on 24 Mar 2017  路  3Comments  路  Source: supasate/connected-react-router

Hi,

I have a problem when switching from "BrowserRouter" to your "ConnectedRouter".
On the router I have the prop "basename" set to "/foo/". So i want all my routes to be prefixed with /foo. For example "/foo/bar".
The connected router ignores the basename and serves all routes from /

Most helpful comment

Sorry for late reply.

You can do that by passing it to createBrowserHistory.

Ex.

const history = createBrowserHistory({
  basename: '/foo/',
})

All 3 comments

Sorry for late reply.

You can do that by passing it to createBrowserHistory.

Ex.

const history = createBrowserHistory({
  basename: '/foo/',
})

Nice, thank you! 馃槂

I just updated the doc.

Was this page helpful?
0 / 5 - 0 ratings