mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
In-Depth Explanation of React Version Handling Doc (#89426)
There have been multiple discussions and some confusion around [React version handling](https://nextjs.org/docs#react-version-handling) in Next.js. This PR adds an in-depth explanation to clarify how React and react-dom versions are managed internally, and why they still need to be declared in package.json. The goal is to help developers better understand this behavior and reduce recurring questions around it. Reference discussion: https://github.com/vercel/next.js/discussions/87958 @icyJoseph --------- Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by: Joseph <[email protected]> Co-authored-by: Joseph <[email protected]>
This commit is contained in:
co-authored by
vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Joseph
Joseph
parent
351a67529b
commit
757ab17e54
@@ -126,7 +126,10 @@ yarn add next@latest react@latest react-dom@latest
|
||||
bun add next@latest react@latest react-dom@latest
|
||||
```
|
||||
|
||||
> **Good to know**: The App Router uses [React canary releases](https://react.dev/blog/2023/05/03/react-canaries) built-in, which include all the stable React 19 changes, as well as newer features being validated in frameworks. The Pages Router uses the React version you install in `package.json`.
|
||||
> **Good to know**:
|
||||
>
|
||||
> - The `App Router` uses [React canary releases](https://react.dev/blog/2023/05/03/react-canaries) built-in, which include all the stable React 19 changes, as well as newer features being validated in frameworks, but you should still declare react and react-dom in package.json for tooling and ecosystem compatibility.
|
||||
> - The `Pages Router` uses the React version from your `package.json`.
|
||||
|
||||
Then, add the following scripts to your `package.json` file:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user