faceyspacey/redux-first-router

no history.entries or history.index

yoavniran opened this issue · 3 comments

I've just upgraded to 2.1.1
I see that the issues described in #285 and #328 are still not really fixed.
yes canGoBack now checks if _history.entries is there but prevPath simply does:

const entry = _history.entries[_history.index - 1]

and I get an error because both _history.entries is undefined and _history.index are undefined.

as far as I can tell, BrowserHistory simply doesnt expose entries prop. in comparison: MemoryHistory does but the code in connectRoutes naively expects it to always be available.

Does that mean that these methods simply cannot be expected to work when (default) BrowserHistory is used?

hmm, theres a pr open to Rudy-history might help resolve things. Otherwise i cannot be sure how this will work with browserHistory.

@ScriptedAlchemy which PR are you referring to? there is only 1 in that repo and i dont see how its related...

@yoavniran perhaps you could PR a similar fix to #291 and apply it to the other two functions that dereference _history.entries?