Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
Provide history in hook locals
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Søvik committed Dec 2, 2016
1 parent ec87638 commit 667fce7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -117,6 +119,7 @@ export default function createClient({ createRoutes, createStore, mountNode }) {
locals = {
dispatch: store.dispatch,
getState: store.getState,
history,
};

createComponent.push((component) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ export function reactRender({
const locals = store ? {
dispatch: store.dispatch,
getState: store.getState,
} : {};
history,
} : {
history,
};

const hooks = rocConfig.runtime.fetch.server;

Expand Down

0 comments on commit 667fce7

Please sign in to comment.