Skip to content

Commit ca9af5b

Browse files
authored
chore(examples): update React to stable 19 (vercel#74499)
## Why? - Update React in reproduction example templates to stable v19 - Switch `.ts` for `next.config` - Fixes vercel#74422
1 parent f25e212 commit ca9af5b

File tree

11 files changed

+59
-44
lines changed

11 files changed

+59
-44
lines changed

examples/reproduction-template-pages/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
npm-debug.log*
2929
yarn-debug.log*
3030
yarn-error.log*
31+
.pnpm-debug.log*
3132

32-
# local env files
33-
.env*.local
33+
# env files (can opt-in for committing if needed)
34+
.env*
3435

3536
# vercel
3637
.vercel

examples/reproduction-template-pages/next.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
reactStrictMode: true,
6+
};
7+
8+
export default nextConfig;

examples/reproduction-template-pages/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
},
88
"dependencies": {
99
"next": "canary",
10-
"react": "19.0.0-beta-04b058868c-20240508",
11-
"react-dom": "19.0.0-beta-04b058868c-20240508"
10+
"react": "^19.0.0",
11+
"react-dom": "^19.0.0"
1212
},
1313
"devDependencies": {
14-
"@types/node": "20.4.5",
15-
"@types/react": "18.2.18",
16-
"typescript": "5.1.3"
14+
"@types/node": "^22",
15+
"@types/react": "^19",
16+
"typescript": "^5"
1717
}
1818
}
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "ES2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,
7-
"strict": false,
8-
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
98
"noEmit": true,
10-
"incremental": true,
119
"esModuleInterop": true,
1210
"module": "esnext",
13-
"moduleResolution": "node",
11+
"moduleResolution": "bundler",
1412
"resolveJsonModule": true,
1513
"isolatedModules": true,
16-
"jsx": "preserve"
14+
"jsx": "preserve",
15+
"incremental": true,
16+
"plugins": [
17+
{
18+
"name": "next"
19+
}
20+
],
21+
"paths": {
22+
"@/*": ["./*"]
23+
}
1724
},
18-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
25+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
1926
"exclude": ["node_modules"]
2027
}

examples/reproduction-template/.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# dependencies
44
/node_modules
5-
/.pnp0
5+
/.pnp
66
.pnp.*
77
.yarn/*
88
!.yarn/patches
@@ -28,9 +28,10 @@
2828
npm-debug.log*
2929
yarn-debug.log*
3030
yarn-error.log*
31+
.pnpm-debug.log*
3132

32-
# local env files
33-
.env*.local
33+
# env files (can opt-in for committing if needed)
34+
.env*
3435

3536
# vercel
3637
.vercel

examples/reproduction-template/app/layout.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
export default function RootLayout({ children }) {
1+
export default function RootLayout({
2+
children,
3+
}: Readonly<{
4+
children: React.ReactNode;
5+
}>) {
26
return (
3-
<html>
4-
<head />
7+
<html lang="en">
58
<body>{children}</body>
69
</html>
710
);

examples/reproduction-template/next.config.mjs

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
reactStrictMode: true,
6+
};
7+
8+
export default nextConfig;

examples/reproduction-template/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
"react-dom": "^19.0.0"
1212
},
1313
"devDependencies": {
14-
"@types/node": "20.12.12",
15-
"@types/react": "18.3.3",
16-
"@types/react-dom": "18.3.0",
17-
"typescript": "5.3.3"
14+
"@types/node": "^22",
15+
"@types/react": "^19",
16+
"typescript": "^5"
1817
}
1918
}

examples/reproduction-template/tsconfig.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "ES2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
66
"skipLibCheck": true,
7-
"strict": false,
8-
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
98
"noEmit": true,
10-
"incremental": true,
119
"esModuleInterop": true,
1210
"module": "esnext",
13-
"moduleResolution": "node",
11+
"moduleResolution": "bundler",
1412
"resolveJsonModule": true,
1513
"isolatedModules": true,
1614
"jsx": "preserve",
15+
"incremental": true,
1716
"plugins": [
1817
{
1918
"name": "next"
2019
}
21-
]
20+
],
21+
"paths": {
22+
"@/*": ["./*"]
23+
}
2224
},
2325
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
2426
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)