diff --git a/extensions/roc-package-web-app-react/app/client/create-client.js b/extensions/roc-package-web-app-react/app/client/create-client.js index 179cb32..fc3b342 100644 --- a/extensions/roc-package-web-app-react/app/client/create-client.js +++ b/extensions/roc-package-web-app-react/app/client/create-client.js @@ -92,7 +92,9 @@ export default function createClient({ createRoutes, createStore, mountNode }) { } let routes; - let locals = {}; + let locals = { + history, + }; const createComponent = [(component) => component]; const createDevComponent = [(component) => component]; @@ -117,6 +119,7 @@ export default function createClient({ createRoutes, createStore, mountNode }) { locals = { dispatch: store.dispatch, getState: store.getState, + history, }; createComponent.push((component) => ( diff --git a/extensions/roc-package-web-app-react/src/app/server/reactRenderer.js b/extensions/roc-package-web-app-react/src/app/server/reactRenderer.js index 8d8637b..a4a110e 100755 --- a/extensions/roc-package-web-app-react/src/app/server/reactRenderer.js +++ b/extensions/roc-package-web-app-react/src/app/server/reactRenderer.js @@ -112,7 +112,10 @@ export function reactRender({ const locals = store ? { dispatch: store.dispatch, getState: store.getState, - } : {}; + history, + } : { + history, + }; const hooks = rocConfig.runtime.fetch.server;