salvoravida/redux-first-history

make actions aware of basename

TeckTn opened this issue · 2 comments

Thanks for this great work !

HistoryRouter allow to set a base name like this :

import { HistoryRouter as ReactRouter } from 'redux-first-history/rr6'

<ReactRouter history={history} basename="someBasePath"}>
...

But actions like (push, replace, go ...) are not aware of the basename so for exemple if I call push("site"), I go to /site instead of /someBasePath/site

Of course I can extract the basePath from the Uri, but I think my request makes sense.

Hi!
Redux-first-history sync history object with redux state, and does not depend on any declarative routing library, so it's correct that the push/replace actions reflect the history ones.

that said, you could introduce a new option "basename" on createReduxHistoryContext to be passed and merged on push/replace actions.

Feel free to open a PR!

@salvoravida Still interested in that PR?

History v5 removing its basename feature made our work on upgrading to rr6, history5, rfh5 a real pain.

Might work on bringing this bit of feature in RFH to at least alleviate some of it.