Skip to content

Commit

Permalink
chore: Migrate with-prefetching example to typescript (#40671)
Browse files Browse the repository at this point in the history
## 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)
  • Loading branch information
HaNdTriX authored Sep 19, 2022
1 parent 6279dba commit 24b20dd
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 3 deletions.
File renamed without changes.
9 changes: 7 additions & 2 deletions examples/with-prefetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
},
"dependencies": {
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.7.18",
"@types/react": "18.0.20",
"typescript": "4.8.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { AppProps } from 'next/app'
import Nav from '../components/Nav'

export default function App({ Component, pageProps }) {
export default function App({ Component, pageProps }: AppProps) {
return (
<>
<Nav />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions examples/with-prefetching/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

0 comments on commit 24b20dd

Please sign in to comment.