First render - unneccasary history.pushState #51
Description
On first page render, if redux DebugPanel is displayed, the simple router calls history.pushState with the existing route. This means that Router.createElement is invoked twice on ReactRouter - which isn't necessary.
The redux DevTools or perhaps LogMonitor seems to trigger the store.subrscribe callback on an interval. Here, RSR is finding that lastChangeId !== routing.changeId;
and so calling the new pushState.
It could be worth caching the routePath
and checking for a difference with the current getState().routing.path
before invoking updatePath
, but of course, that wouldn't take into account any route state changes.
It may be more simple to initialise the lastChangeId
to the same value as initialState.changeId
- again, there's probably a use case in here somewhere that route.state updates on initial render wouldn't be taken into account...
Perhaps #50 could prevent the unnecessary pushState call on initial render.