redux-router v1.0.0-beta3 Release Notes
Release Date: 2015-09-17 // over 8 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 passroutes
(orgetRoutes()
โ see below) directly to thereduxReactRouter()
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).