Unverified Commit a2bd33f4 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add explicit section about type overriding for v15 (#72866)

This breaks out the type overriding note from a small good to know
section to it's own section as it's fairly important and easy to miss
currently. Also the minimal note isn't getting picked up in our search
currently.

x-ref: [slack
thread](https://vercel.slack.com/archives/C0676QZBWKS/p1731602395153929)
parent 0402ced7
...@@ -22,7 +22,6 @@ npm i next@latest react@rc react-dom@rc eslint-config-next@latest ...@@ -22,7 +22,6 @@ npm i next@latest react@rc react-dom@rc eslint-config-next@latest
> **Good to know:** > **Good to know:**
> >
> - If you see a peer dependencies warning, you may need to update `react` and `react-dom` to the suggested versions, or you use the `--force` or `--legacy-peer-deps` flag to ignore the warning. This won't be necessary once both Next.js 15 and React 19 are stable. > - If you see a peer dependencies warning, you may need to update `react` and `react-dom` to the suggested versions, or you use the `--force` or `--legacy-peer-deps` flag to ignore the warning. This won't be necessary once both Next.js 15 and React 19 are stable.
> - If you are using TypeScript, you'll need to temporarily override the React types. See the [React 19 RC upgrade guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing) for more information.
## React 19 ## React 19
...@@ -31,6 +30,23 @@ npm i next@latest react@rc react-dom@rc eslint-config-next@latest ...@@ -31,6 +30,23 @@ npm i next@latest react@rc react-dom@rc eslint-config-next@latest
- `useFormStatus` now includes additional keys like `data`, `method`, and `action`. If you are not using React 19, only the `pending` key is available. [Learn more](https://react.dev/reference/react-dom/hooks/useFormStatus). - `useFormStatus` now includes additional keys like `data`, `method`, and `action`. If you are not using React 19, only the `pending` key is available. [Learn more](https://react.dev/reference/react-dom/hooks/useFormStatus).
- Read more in the [React 19 upgrade guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide). - Read more in the [React 19 upgrade guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide).
### Updating types for react 19
If you are using TypeScript, you'll need to temporarily override the React types. Below is an example of the necessary type overrides needed in your `package.json`. See the [React 19 RC upgrade guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing) for more information.
```json
{
"dependencies": {
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc"
},
"overrides": {
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc"
}
}
```
## Async Request APIs (Breaking change) ## Async Request APIs (Breaking change)
Previously synchronous Dynamic APIs that rely on runtime information are now **asynchronous**: Previously synchronous Dynamic APIs that rely on runtime information are now **asynchronous**:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment