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) #31829

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
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 "[email protected]57768ef90" and "[email protected]57768ef90" or higher.`
`The GATSBY_EXPERIMENTAL_CONCURRENT_FEATURES flag is not compatible with your React version. Please install "[email protected]2bf4805e4" and "[email protected]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