Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Update with-loading example (#39646)
Changelog Updated dependencies Migrated to Typescript Use CSS from npm module Documentation / Examples Make sure the linting passes by running pnpm lint The examples guidelines are followed from our contributing doc
- Loading branch information
Showing
8 changed files
with
42 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
examples/with-loading/pages/_app.js → examples/with-loading/pages/_app.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
examples/with-loading/pages/about.js → examples/with-loading/pages/about.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const AboutPage = () => <p>This is about Next.js!</p> | ||
|
||
export async function getServerSideProps() { | ||
await new Promise((resolve) => { | ||
setTimeout(resolve, 500) | ||
}) | ||
return { props: {} } | ||
} | ||
|
||
export default AboutPage | ||
export default function AboutPage() { | ||
return <p>This is about Next.js!</p> | ||
} |
6 changes: 3 additions & 3 deletions
6
examples/with-loading/pages/forever.js → examples/with-loading/pages/forever.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const ForeverPage = () => <p>This page was rendered for a while!</p> | ||
|
||
export async function getServerSideProps() { | ||
await new Promise((resolve) => { | ||
setTimeout(resolve, 3000) | ||
}) | ||
return { props: {} } | ||
} | ||
|
||
export default ForeverPage | ||
export default function ForeverPage() { | ||
return <p>This page was rendered for a while!</p> | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function IndexPage() { | ||
return <p>Hello Next.js!</p> | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |