Unverified Commit 5f5b2664 authored by Max Proske's avatar Max Proske Committed by GitHub

Convert basic-export example to TypeScript (#38092)

Converted basic Export example over to TypeScript to match the Contribution guidelines.


## 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.md#adding-examples)
parent 55560e0c
......@@ -32,3 +32,6 @@ yarn-error.log*
# vercel
.vercel
# typescript
*.tsbuildinfo
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
......@@ -7,7 +7,13 @@
},
"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.0.0",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"typescript": "^4.7.4"
}
}
export default function About() {
const About = () => {
return <div>About us</div>
}
export default About
export default function About2() {
const About2 = () => {
return <div>About 2</div>
}
export default About2
export default function Day() {
const Day = () => {
return <div>Hello Day</div>
}
export default Day
import Link from 'next/link'
export default function Home() {
const Home = () => {
return (
<div>
Hello World.{' '}
......@@ -9,3 +10,5 @@ export default function Home() {
</div>
)
}
export default Home
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"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