Skip to content

Commit

Permalink
Hydrate when the page was server rendered (#29016)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jan 14, 2021
1 parent e72533d commit bf6f264
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/gatsby/cache-dir/app.js
Expand Up @@ -119,9 +119,11 @@ apiRunnerAsync(`onClientEntry`).then(() => {
const renderer = apiRunner(
`replaceHydrateFunction`,
undefined,
// TODO replace with hydrate once dev SSR is ready
// but only for SSRed pages.
ReactDOM.render
// Client only pages have any empty body so we just do a normal
// render to avoid React complaining about hydration mis-matches.
document.getElementById(`___gatsby`).children.length === 0
? ReactDOM.render
: ReactDOM.hydrate
)[0]

let dismissLoadingIndicator
Expand Down

0 comments on commit bf6f264

Please sign in to comment.