Skip to content

Commit

Permalink
Add getRenderer method
Browse files Browse the repository at this point in the history
Signed-off-by: slorber <lorber.sebastien@gmail.com>
  • Loading branch information
slorber committed Apr 17, 2018
1 parent 9c79548 commit 7fc2693
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/gatsby/cache-dir/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ apiRunnerAsync(`onClientEntry`).then(() => {
Root = Root.default
}

const renderer = apiRunner(`getRenderer`, undefined, ReactDOM.render)[0]

domReady(() =>
ReactDOM.render(
renderer(
<HotContainer>
<Root />
</HotContainer>,
Expand Down
5 changes: 4 additions & 1 deletion packages/gatsby/cache-dir/production-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ apiRunnerAsync(`onClientEntry`).then(() => {
)

const NewRoot = apiRunner(`wrapRootComponent`, { Root }, Root)[0]

const renderer = apiRunner(`getRenderer`, undefined, ReactDOM.render)[0]

domReady(() =>
ReactDOM.render(
renderer(
<NewRoot />,
typeof window !== `undefined`
? document.getElementById(`___gatsby`)
Expand Down

0 comments on commit 7fc2693

Please sign in to comment.