fix(deps): ensure Next.js 15.2.0 compatibility, upgrade nextjs and @types/react versions in monorepo (#11419)

This bumps next.js to 15.2.0 in our monorepo, as well as all @types/react and @types/react-dom versions. Additionally, it removes the obsolete `peerDependencies` property from our root package.json.

This PR also fixes 2 bugs introduced by Next.js 15.2.0. This highlights why running our test suite against the latest Next.js, to make sure Payload is compatible, version is important.

## 1. handleWhereChange running endlessly

Upgrading to Next.js 15.2.0 caused `handleWhereChange` to be continuously called by a `useEffect` when the list view filters were opened, leading to a React error - I did not investigate why upgrading the Next.js version caused that, but this PR fixes it by making use of the more predictable `useEffectEvent`.

## 2. Custom Block and Array label React key errors

Upgrading to Next.js 15.2.0 caused react key errors when rendering custom block and array row labels on the server. This has been fixed by rendering those with a key

## 3. Table React key errors

When rendering a `Table`, a React key error is thrown since Next.js 15.2.0
This commit is contained in:
Alessio Gravili
2025-02-26 22:56:09 -07:00
committed by GitHub
parent 958e195017
commit 2a3682ff68
18 changed files with 194 additions and 186 deletions

View File

@@ -60,8 +60,8 @@
"devDependencies": {
"@payloadcms/eslint-config": "workspace:*",
"@swc/core": "1.10.12",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"dotenv": "16.4.7",
"prettier": "3.3.3",
"typescript": "5.7.3"