redux-router v1.0.0-beta3 Release Notes

Release Date: 2015-09-17 // about 5 years ago
  • ๐Ÿš€ It turns out that the dynamic routes feature from the last release won't work for server-side rendering, because the routes need to be specified before calling match(). You must pass routes (or getRoutes() โ€” see below) directly to the reduxReactRouter() store enhancer when doing server-side rendering. We throw an error if you don't.

    ๐Ÿš€ This makes circular dependencies (routes depend on store, store depends on routes) more difficult on the server, so this release also brings back a modified version of getRoutes().

    reduxReactRouter({ getRoutes({ getState, dispatch }) { // Return routes configuration } })

    โ†ช Note that you can always use a closure to work around a circular dependency:

    let store;function doSomethingOnEnter() { store.dispatch(whatever); }const routes = ( \<Route\>\<Router path="/" onEnter={doSomethingOnEnter} /\>\</Route\>); store = reduxReactRouter({ routes })(createStore)(reducer, initialState);

    This is essentially what getRoutes() does for you.

    ๐Ÿš€ Thank you to everybody who has been testing the betas so we can identify and fix issues like these! I am optimistic about a stable 1.0 release coming out soon (or whenever React Router releases their 1.0).