Skip to content

Commit 24b20dd

Browse files
authored
chore: Migrate with-prefetching example to typescript (#40671)
## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
1 parent 6279dba commit 24b20dd

File tree

8 files changed

+29
-3
lines changed

8 files changed

+29
-3
lines changed

examples/with-prefetching/package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
},
88
"dependencies": {
99
"next": "latest",
10-
"react": "^17.0.2",
11-
"react-dom": "^17.0.2"
10+
"react": "^18.2.0",
11+
"react-dom": "^18.2.0"
12+
},
13+
"devDependencies": {
14+
"@types/node": "18.7.18",
15+
"@types/react": "18.0.20",
16+
"typescript": "4.8.3"
1217
}
1318
}

examples/with-prefetching/pages/_app.js examples/with-prefetching/pages/_app.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import type { AppProps } from 'next/app'
12
import Nav from '../components/Nav'
23

3-
export default function App({ Component, pageProps }) {
4+
export default function App({ Component, pageProps }: AppProps) {
45
return (
56
<>
67
<Nav />
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"noEmit": true,
10+
"incremental": true,
11+
"esModuleInterop": true,
12+
"module": "esnext",
13+
"moduleResolution": "node",
14+
"resolveJsonModule": true,
15+
"isolatedModules": true,
16+
"jsx": "preserve"
17+
},
18+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
19+
"exclude": ["node_modules"]
20+
}

0 commit comments

Comments
 (0)