From 7fc2693d13996868312f9f60ffb41603735fe7d1 Mon Sep 17 00:00:00 2001 From: slorber Date: Tue, 17 Apr 2018 15:39:29 +0200 Subject: [PATCH] Add getRenderer method Signed-off-by: slorber --- packages/gatsby/cache-dir/app.js | 4 +++- packages/gatsby/cache-dir/production-app.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/gatsby/cache-dir/app.js b/packages/gatsby/cache-dir/app.js index e64f76cb8ceb7..65485ecefecc1 100644 --- a/packages/gatsby/cache-dir/app.js +++ b/packages/gatsby/cache-dir/app.js @@ -39,8 +39,10 @@ apiRunnerAsync(`onClientEntry`).then(() => { Root = Root.default } + const renderer = apiRunner(`getRenderer`, undefined, ReactDOM.render)[0] + domReady(() => - ReactDOM.render( + renderer( , diff --git a/packages/gatsby/cache-dir/production-app.js b/packages/gatsby/cache-dir/production-app.js index 24b913542b3ae..0b4fccd1c414e 100644 --- a/packages/gatsby/cache-dir/production-app.js +++ b/packages/gatsby/cache-dir/production-app.js @@ -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( , typeof window !== `undefined` ? document.getElementById(`___gatsby`)