Udpate react-router-redux
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user