-
Notifications
You must be signed in to change notification settings - Fork 648
Server-side rendering being discarded #31
Comments
You don't need to use it for your server side rendering. Just render it using regular old react-router on the server side and redux-react. You'll end up having something to the effect of this inside your <Provider store={store}>
<RoutingContext {...renderProps} />
</Provider> |
same here #33 |
I get it work @crossman |
Indeed. This project is not intended to document or take over routing at all, it's only meant to make sure the route state (the URL) is synced with the redux store so you can always recreate your app based on that state. All functionality (especially advanced stuff like server-side rendering) should just go through react-router. I am going to document this somehow though. A few basic examples + links for where to look at react-router's docs would be nice. Keep an eye on https://github.com/erikras/react-redux-universal-hot-example, we're going to switch it to this project soon and you can see server-rendering code there. |
It's beautiful how simple it is to implement this. But I'm having some trouble with server-side rendering. I added the
syncReduxAndRouter
function where the client is initiated. But what should be done in the server? SincecreateHistory
can't be used?It's a little obvious but the markup from my server and my client are different, and my server-side rendering is being discarded. You can clone the redux-simple-router branch of my repo if you want to test it out.
The text was updated successfully, but these errors were encountered: