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 signature for latest experimental version of react-dom #31750

Merged
merged 2 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/gatsby/cache-dir/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ window.___emitter = emitter

if (
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES &&
!ReactDOM.unstable_createRoot
!(ReactDOM.createRoot || ReactDOM.unstable_createRoot)
) {
throw new Error(
`The GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES flag is not compatible with your React version. Please install "react@0.0.0-experimental-57768ef90" and "react-dom@0.0.0-experimental-57768ef90" or higher.`
Expand Down Expand Up @@ -143,9 +143,9 @@ apiRunnerAsync(`onClientEntry`).then(() => {
if (focusEl && focusEl.children.length) {
if (
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES &&
ReactDOM.unstable_createRoot
(ReactDOM.createRoot || ReactDOM.unstable_createRoot)
) {
defaultRenderer = ReactDOM.unstable_createRoot
defaultRenderer = (ReactDOM.createRoot || ReactDOM.unstable_createRoot)
} else {
defaultRenderer = ReactDOM.hydrate
}
Expand Down Expand Up @@ -203,7 +203,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
)
document.body.append(indicatorMountElement)

if (renderer === ReactDOM.unstable_createRoot) {
if (renderer === (ReactDOM.createRoot || ReactDOM.unstable_createRoot)) {
renderer(indicatorMountElement).render(
<LoadingIndicatorEventHandler />
)
Expand Down Expand Up @@ -232,7 +232,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
dismissLoadingIndicator()
}

if (renderer === ReactDOM.unstable_createRoot) {
if (renderer === (ReactDOM.createRoot || ReactDOM.unstable_createRoot)) {
renderer(rootElement, {
hydrate: true,
}).render(<App />)
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/cache-dir/production-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
`replaceHydrateFunction`,
undefined,
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES
? ReactDOM.unstable_createRoot
? (ReactDOM.createRoot || ReactDOM.unstable_createRoot)
: ReactDOM.hydrate
)[0]

Expand All @@ -204,7 +204,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
? document.getElementById(`___gatsby`)
: null

if (renderer === ReactDOM.unstable_createRoot) {
if (renderer === (ReactDOM.createRoot || ReactDOM.unstable_createRoot)) {
renderer(container, {
hydrate: true,
}).render(<App />)
Expand Down