-
Notifications
You must be signed in to change notification settings - Fork 642
Bug: On server side history change is not propagated to store #284
Comments
When i have used memoryHistory on client, everything is propagated to the store, so issue probably will be with react-router match not triggering listen Temporary fix on my side was adding this to react-router match callback
|
OK, I'm getting a handle on this finally. I've got a SSR example (that will go up in the next version!) and I'm seeing what both you and @romseguy. The redirect happens because we're detecting the initial load as a replay and it's attempting to go back to the initial location. That's a bit of red herring, as the actual issue is that they location state generated by That default location is const memoryHistory = createMemoryHistory(req.path) // Or whatever request path variable koa or others user That's it! 😄 |
Is there any way for us or for |
Nope, it's a router/history bug. We shouldn't have a default and should throw when an initial location isn't provided. Working on a fix now. |
This smells off to me. Why are you syncing history to store when rendering on the server? |
@timdorr thanks, now it works as expected |
On server side, accessing any route does not change redux state.
Setup on server side:
After react-router match
store.geState()
returned this:On client side, after syncing history with store, redirect to
/
is triggered.Issue can be simulated on this repo svrcekmichal\universal-react
Server side setup is here
The text was updated successfully, but these errors were encountered: