Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby): Fix various small DEV_SSR bugs exposed in development_runtime tests #29720

Merged
merged 13 commits into from
Mar 1, 2021
Merged
Prev Previous commit
Next Next commit
test this
  • Loading branch information
KyleAMathews committed Feb 26, 2021
commit 0e95ada6391c6c3bdc827279b8e3c21f9b2920ab
5 changes: 2 additions & 3 deletions packages/gatsby/cache-dir/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,13 @@ apiRunnerAsync(`onClientEntry`).then(() => {

const rootElement = document.getElementById(`___gatsby`)

const focusEl = document.getElementById(`gatsby-focus-wrapper`)
const renderer = apiRunner(
`replaceHydrateFunction`,
undefined,
// 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-focus-wrapper`).children.length === 0
? ReactDOM.render
: ReactDOM.hydrate
focusEl && focusEl.children.length > 0 ? ReactDOM.hydrate : ReactDOM.render
)[0]

let dismissLoadingIndicator
Expand Down