Skip to content

Commit

Permalink
fix(gatsby): fix signature for latest experimental version of react-d…
Browse files Browse the repository at this point in the history
…om (#31750) (#31829)

(cherry picked from commit 087cdd5)

Co-authored-by: Hyeseong Kim <hey@hyeseong.kim>
  • Loading branch information
GatsbyJS Bot and cometkim committed Jun 8, 2021
1 parent 34176c6 commit 2a4ea62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/gatsby/cache-dir/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ window.___emitter = emitter

if (
process.env.GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES &&
!ReactDOM.unstable_createRoot
!ReactDOM.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.`
`The GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES flag is not compatible with your React version. Please install "react@0.0.0-experimental-2bf4805e4" and "react-dom@0.0.0-experimental-2bf4805e4" 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
) {
defaultRenderer = ReactDOM.unstable_createRoot
defaultRenderer = ReactDOM.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) {
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) {
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.hydrate
)[0]

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

if (renderer === ReactDOM.unstable_createRoot) {
if (renderer === ReactDOM.createRoot) {
renderer(container, {
hydrate: true,
}).render(<App />)
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/utils/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ const activeFlags: Array<IFlag> = [
testFitness: (): fitnessEnum => {
// Because of this, this flag will never show up
const semverConstraints = {
react: `^0.0.0-experimental-57768ef90`,
"react-dom": `^0.0.0-experimental-57768ef90`,
react: `^0.0.0-experimental-2bf4805e4`,
"react-dom": `^0.0.0-experimental-2bf4805e4`,
}

if (satisfiesSemvers(semverConstraints)) {
Expand Down

0 comments on commit 2a4ea62

Please sign in to comment.