Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
bd589349
Unverified
Commit
bd589349
authored
May 28, 2021
by
Gerald Monaco
Committed by
GitHub
May 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assume a recent `react@experimental` if `reactRoot` is set (#25496)
parent
8a067804
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
webpack-config.ts
packages/next/build/webpack-config.ts
+5
-4
index.tsx
packages/next/client/index.tsx
+1
-5
No files found.
packages/next/build/webpack-config.ts
View file @
bd589349
...
@@ -234,10 +234,11 @@ export default async function getBaseWebpackConfig(
...
@@ -234,10 +234,11 @@ export default async function getBaseWebpackConfig(
const
reactVersion
=
await
getPackageVersion
({
cwd
:
dir
,
name
:
'react'
})
const
reactVersion
=
await
getPackageVersion
({
cwd
:
dir
,
name
:
'react'
})
const
hasReactRefresh
:
boolean
=
dev
&&
!
isServer
const
hasReactRefresh
:
boolean
=
dev
&&
!
isServer
const
hasJsxRuntime
:
boolean
=
const
hasJsxRuntime
:
boolean
=
Boolean
(
reactVersion
)
&&
config
.
experimental
.
reactRoot
||
// 17.0.0-rc.0 had a breaking change not compatible with Next.js, but was
(
Boolean
(
reactVersion
)
&&
// fixed in rc.1.
// 17.0.0-rc.0 had a breaking change not compatible with Next.js, but was
semver
.
gte
(
reactVersion
!
,
'17.0.0-rc.1'
)
// fixed in rc.1.
semver
.
gte
(
reactVersion
!
,
'17.0.0-rc.1'
))
const
babelConfigFile
=
await
[
const
babelConfigFile
=
await
[
'.babelrc'
,
'.babelrc'
,
...
...
packages/next/client/index.tsx
View file @
bd589349
...
@@ -508,11 +508,7 @@ function renderReactElement(
...
@@ -508,11 +508,7 @@ function renderReactElement(
const
reactEl
=
fn
(
shouldHydrate
?
markHydrateComplete
:
markRenderComplete
)
const
reactEl
=
fn
(
shouldHydrate
?
markHydrateComplete
:
markRenderComplete
)
if
(
process
.
env
.
__NEXT_REACT_ROOT
)
{
if
(
process
.
env
.
__NEXT_REACT_ROOT
)
{
if
(
!
reactRoot
)
{
if
(
!
reactRoot
)
{
const
createRootName
=
reactRoot
=
(
ReactDOM
as
any
).
createRoot
(
domEl
,
{
typeof
(
ReactDOM
as
any
).
unstable_createRoot
===
'function'
?
'unstable_createRoot'
:
'createRoot'
reactRoot
=
(
ReactDOM
as
any
)[
createRootName
](
domEl
,
{
hydrate
:
shouldHydrate
,
hydrate
:
shouldHydrate
,
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment