Skip to content

Commit

Permalink
Merge branch 'canary' into img-alt-text-eslint-rule
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored May 28, 2021
2 parents 78af239 + bd58934 commit a07e9e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 5 additions & 4 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,11 @@ export default async function getBaseWebpackConfig(
const reactVersion = await getPackageVersion({ cwd: dir, name: 'react' })
const hasReactRefresh: boolean = dev && !isServer
const hasJsxRuntime: boolean =
Boolean(reactVersion) &&
// 17.0.0-rc.0 had a breaking change not compatible with Next.js, but was
// fixed in rc.1.
semver.gte(reactVersion!, '17.0.0-rc.1')
config.experimental.reactRoot ||
(Boolean(reactVersion) &&
// 17.0.0-rc.0 had a breaking change not compatible with Next.js, but was
// fixed in rc.1.
semver.gte(reactVersion!, '17.0.0-rc.1'))

const babelConfigFile = await [
'.babelrc',
Expand Down
6 changes: 1 addition & 5 deletions packages/next/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,7 @@ function renderReactElement(
const reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete)
if (process.env.__NEXT_REACT_ROOT) {
if (!reactRoot) {
const createRootName =
typeof (ReactDOM as any).unstable_createRoot === 'function'
? 'unstable_createRoot'
: 'createRoot'
reactRoot = (ReactDOM as any)[createRootName](domEl, {
reactRoot = (ReactDOM as any).createRoot(domEl, {
hydrate: shouldHydrate,
})
}
Expand Down

0 comments on commit a07e9e9

Please sign in to comment.