-
Notifications
You must be signed in to change notification settings - Fork 644
Conversation
import { createHistory } from 'history' | ||
|
||
// Creates a memoryHistory with a necessary initial pathname. | ||
const history = createHistory({ entries: [ req.url ] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this section? I don't think this is the right way to do server-rendering. Why do you have a history object at all? You should be using the lower-level match
API directly.
Thanks a lot for this! I'll merge one you remove that section. That's not the right place for an implementation detail; for server-rendering I'd rather link to proper example once we get there. |
Fix typo Clearify LocationDescriptor Added API entry for syncHistoryToStore Simplify Server-side example Removed Server-side example
Removed, rebased, squashed :) Server rendering works pretty neat for me once I figured out that I have to hydrate a memoryHistory and pass that to |
Personally I update the state after creating the server-side store with a |
@jlongster routeActions is undefined in the current npm package. happy to file a separate issue… |
Nope, I'm about to release 2.0.0 so we updated the readme in preparation for it. |
I sorta figured that out as the day went on :). Using 2.0 on dev right now in anticipation of the release, so I should be all ready. |
Is the 2.0.0. release scheduled for today? (I know this question would be better off in a separate issue, but since it has been brought up here and @jlongster said it should not be dealt with since 2.0.0 is about to be released, i figured i'd should just post it here) |
Yes it will be released today. |
This PR updates the readme.md to reflect the API changes introduced mostly in #141 by @taion.
It also adds a little section for server-side usage - explaining that the memoryHistory has to be hydrated with the current location from the server for redux-simple-router to determine the correct initialState.