Skip to content

Commit

Permalink
feat(custom-renderer): provided the request to the custom renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Feb 28, 2020
1 parent 4e33c21 commit f3e7d17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/router-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function renderThroughReactRouter(request, h, {render, rout
return respond(h, {
store,
status,
renderedContent: render ? render(defaultRender) : {html: defaultRender()}
renderedContent: render ? render(defaultRender, request) : {html: defaultRender()}
});
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/router-wrapper-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ suite('router-wrapper', () => {
dataFetcher.default.withArgs({renderProps, store, status}).resolves({renderProps, status});
respond.withArgs(reply, {renderedContent, store, status}).returns(response);
defaultRenderFactory.default.withArgs(request, store, renderProps, Root).returns(defaultRender);
render.withArgs(defaultRender).returns(renderedContent);
render.withArgs(defaultRender, request).returns(renderedContent);

assert.equal(await renderThroughReactRouter(request, reply, {render, routes, respond, Root, store}), response);
});
Expand Down

0 comments on commit f3e7d17

Please sign in to comment.