7 ms·
We export createMemoryHistory instead of a singleton for the server. If you don't like the singletons on the browser side, you can use the useRouter enhancer to
by timdorr 11y ago
We export createMemoryHistory instead of a singleton for the server. If you don't like the singletons on the browser side, you can use the useRouter enhancer to pop in any history creation function you'd like.
- sandGorgon 11y agoIs there a doc on this? A simple example with pagination done client side or server side..that illustrates history.
- timdorr 11y agoWe normally hide this behind the `match` API: https://github.com/rackt/react-router/blob/master/docs/guides/advanced/ServerRendering.md https://github.com/rackt/react-router/blob/master/docs/guide... Of course, that API is quite opaque and doesn't give you a history object you work with. It's really just a boilerplate reducer or macro for SSR. You can copy out what's going on inside of the function, but that's pretty crappy for you to have to manage. I think, in addition to the docs sucking, we need to come up with a better API for SSR. If you're using redux-simple-router or other integrations that rely on history, it's entirely unusable. We need to fix this.
- sandGorgon 11y agogotcha. do you have an example for the client side history management with ES6 ? Its been a challenge to figure out the right documentation for ES6 - especially the proptypes declaration. I dont think you need to do a lot of explanatory docs - if you have canonical examples, that would be more than enough.