React-router: ConnectedRouter not supporting basename

Created on 21 Mar 2017  路  1Comment  路  Source: ReactTraining/react-router

Is ConnectedRouter is not supporting basename? I simply replaced the default BrowserRouter (supporting basename) with ConnectedRouter.

Not working:

    <ConnectedRouter basename="/user" history={history}>
        <Route path="/auth" component={Auth} />
        <Route path="/home" component={Home} />

Working:

    <ConnectedRouter history={history}>
        <Route path="/user/auth" component={Auth} />
        <Route path="/user/home" component={Home} />

Most helpful comment

With <ConnectedRouter> you supply your own history object. You should be providing the basename option to the call that creates it.

const history = createHistory({ basename: '/user' })

>All comments

With <ConnectedRouter> you supply your own history object. You should be providing the basename option to the call that creates it.

const history = createHistory({ basename: '/user' })
Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexyaseen picture alexyaseen  路  3Comments

ackvf picture ackvf  路  3Comments

maier-stefan picture maier-stefan  路  3Comments

sarbbottam picture sarbbottam  路  3Comments

stnwk picture stnwk  路  3Comments