Skip to content

Update the minimum version of React to use Fast Refresh #20016

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions errors/react-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Your project is using an old version of `react` or `react-dom` that does not
meet the suggested minimum version requirement.

Next.js suggests using, at a minimum, `react@16.10.0` and `react-dom@16.10.0`.
Next.js suggests using, at a minimum, `react@16.9.0` and `react-dom@16.9.0`.
Older versions of `react` and `react-dom` do work with Next.js, however, they do
not enable all of Next.js' features.

Expand Down Expand Up @@ -39,8 +39,8 @@ yarn add react@latest react-dom@latest
```json
{
"dependencies": {
"react": "^16.10.0",
"react-dom": "^16.10.0"
"react": "^16.9.0",
"react-dom": "^16.9.0"
}
}
```
Expand Down
8 changes: 4 additions & 4 deletions packages/next/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ const nextDev: cliCommand = (argv) => {
})
if (
reactVersion &&
semver.lt(reactVersion, '16.10.0') &&
semver.lt(reactVersion, '16.9.0') &&
semver.coerce(reactVersion)?.version !== '0.0.0'
) {
Log.warn(
'Fast Refresh is disabled in your application due to an outdated `react` version. Please upgrade 16.10 or newer!' +
'Fast Refresh is disabled in your application due to an outdated `react` version. Please upgrade 16.9 or newer!' +
' Read more: https://err.sh/next.js/react-version'
)
} else {
Expand All @@ -82,11 +82,11 @@ const nextDev: cliCommand = (argv) => {
})
if (
reactDomVersion &&
semver.lt(reactDomVersion, '16.10.0') &&
semver.lt(reactDomVersion, '16.9.0') &&
semver.coerce(reactDomVersion)?.version !== '0.0.0'
) {
Log.warn(
'Fast Refresh is disabled in your application due to an outdated `react-dom` version. Please upgrade 16.10 or newer!' +
'Fast Refresh is disabled in your application due to an outdated `react-dom` version. Please upgrade 16.9 or newer!' +
' Read more: https://err.sh/next.js/react-version'
)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.