Unverified Commit ca9af5bc authored by Sam Ko's avatar Sam Ko Committed by GitHub

chore(examples): update React to stable 19 (#74499)

## Why?

- Update React in reproduction example templates to stable v19
- Switch `.ts` for `next.config`
- Fixes https://github.com/vercel/next.js/issues/74422
parent f25e2127
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
.pnpm-debug.log*
# local env files # env files (can opt-in for committing if needed)
.env*.local .env*
# vercel # vercel
.vercel .vercel
......
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = nextConfig;
/** import type { NextConfig } from "next";
* @type {import('next').NextConfig}
*/ const nextConfig: NextConfig = {
const nextConfig = { /* config options here */
reactStrictMode: true, reactStrictMode: true,
}; };
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
}, },
"dependencies": { "dependencies": {
"next": "canary", "next": "canary",
"react": "19.0.0-beta-04b058868c-20240508", "react": "^19.0.0",
"react-dom": "19.0.0-beta-04b058868c-20240508" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.4.5", "@types/node": "^22",
"@types/react": "18.2.18", "@types/react": "^19",
"typescript": "5.1.3" "typescript": "^5"
} }
} }
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": false, "strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true, "noEmit": true,
"incremental": true,
"esModuleInterop": true, "esModuleInterop": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve" "jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# dependencies # dependencies
/node_modules /node_modules
/.pnp0 /.pnp
.pnp.* .pnp.*
.yarn/* .yarn/*
!.yarn/patches !.yarn/patches
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
.pnpm-debug.log*
# local env files # env files (can opt-in for committing if needed)
.env*.local .env*
# vercel # vercel
.vercel .vercel
......
export default function RootLayout({ children }) { export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return ( return (
<html> <html lang="en">
<head />
<body>{children}</body> <body>{children}</body>
</html> </html>
); );
......
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
reactStrictMode: true,
};
export default nextConfig;
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.12.12", "@types/node": "^22",
"@types/react": "18.3.3", "@types/react": "^19",
"@types/react-dom": "18.3.0", "typescript": "^5"
"typescript": "5.3.3"
} }
} }
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": false, "strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true, "noEmit": true,
"incremental": true,
"esModuleInterop": true, "esModuleInterop": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "preserve",
"incremental": true,
"plugins": [ "plugins": [
{ {
"name": "next" "name": "next"
} }
] ],
"paths": {
"@/*": ["./*"]
}
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
......
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