Udpate react-router-redux

This commit is contained in:
Berkeley Martinez
2016-06-14 09:31:41 -07:00
parent 5a736a6218
commit 2207a26ee9
3 changed files with 17 additions and 10 deletions

View File

@@ -23,6 +23,7 @@ const routes = { components: App, ...childRoutes };
// createApp(settings: {
// location?: Location|String,
// history?: History,
// syncHistoryWithStore?: ((history, store) => history) = (x) => x,
// initialState?: Object|Void,
// serviceOptions?: Object,
// middlewares?: Function[],
@@ -35,6 +36,8 @@ const routes = { components: App, ...childRoutes };
export default function createApp({
location,
history,
syncHistoryWithStore = (x) => x,
syncOptions = {},
initialState,
serviceOptions = {},
middlewares: sideMiddlewares = [],
@@ -69,6 +72,9 @@ export default function createApp({
// call enhanced createStore function with reducer and initialState
// to create store
const store = compose(...enhancers)(createStore)(reducer, initialState);
// sync history client side with store.
// server side this is an identity function and history is undefined
history = syncHistoryWithStore(history, store, syncOptions);
// createRouteProps({
// redirect: LocationDescriptor,