Closed ghost closed 8 years ago
@SkateFreak Do you speak about server-side rendering? Browser-history obvisouly won´t work on a server. You can use createMemoryHistory
for that.
Take a look at the source code of this repo: https://github.com/erikras/react-redux-universal-hot-example
do i need that history on the server? or can i rule out the usage of it while rendering react on the server
I guess it should work without it as far as i can see. Just tried it with the boilerplate from the repo I recommended you (initiated the store with null
instead of createHistory
).
so far im not enjoining the company of the Router object in
window.__INITIAL_STATE__
(after i ruled it out by checking if typeof(window) !== 'undefined'
):
might be the 'null' you were talking about. thank you for your help.
for anyone who's interested, i uploaded my boilerplate (i had a hard time finding this combination in a simple way for me to start off from)
it includes: Universal Redux Router Redux DevTools HMR (works with the router nicely) Less Loader
@SkateFreak Closing this up. For questions like this, try using stackoverflow, you might get your answer quicker.
import createHistory from 'history/lib/createBrowserHistory'
im having problems rendering to string with this include.
any ideas? thanks