forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Examples for Fast Refresh (vercel#13068)
- Loading branch information
Showing
254 changed files
with
2,336 additions
and
1,886 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
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
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 +1,3 @@ | ||
export default () => <div>About us</div> | ||
export default function About() { | ||
return <div>About us</div> | ||
} |
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 +1,3 @@ | ||
export default () => <div>This is the contact page.</div> | ||
export default function Contact() { | ||
return <div>This is the contact page.</div> | ||
} |
20 changes: 11 additions & 9 deletions
20
examples/api-routes-apollo-server-and-client-auth/pages/about.js
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,11 +1,13 @@ | ||
import Link from 'next/link' | ||
|
||
export default () => ( | ||
<div> | ||
This is a static page goto{' '} | ||
<Link href="/"> | ||
<a>dynamic</a> | ||
</Link>{' '} | ||
page. | ||
</div> | ||
) | ||
export default function About() { | ||
return ( | ||
<div> | ||
This is a static page goto{' '} | ||
<Link href="/"> | ||
<a>dynamic</a> | ||
</Link>{' '} | ||
page. | ||
</div> | ||
) | ||
} |
20 changes: 11 additions & 9 deletions
20
examples/api-routes-apollo-server-and-client/pages/about.js
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,11 +1,13 @@ | ||
import Link from 'next/link' | ||
|
||
export default () => ( | ||
<div> | ||
This is a static page goto{' '} | ||
<Link href="/"> | ||
<a>dynamic</a> | ||
</Link>{' '} | ||
page. | ||
</div> | ||
) | ||
export default function About() { | ||
return ( | ||
<div> | ||
This is a static page goto{' '} | ||
<Link href="/"> | ||
<a>dynamic</a> | ||
</Link>{' '} | ||
page. | ||
</div> | ||
) | ||
} |
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
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,7 +1,7 @@ | ||
// Fake users data | ||
const users = [{ id: 1 }, { id: 2 }, { id: 3 }] | ||
|
||
export default (req, res) => { | ||
export default function handler(req, res) { | ||
// Get data from your database | ||
res.status(200).json(users) | ||
} |
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,9 +1,11 @@ | ||
import Link from 'next/link' | ||
|
||
export default ({ person }) => ( | ||
<li> | ||
<Link href="/person/[id]" as={`/person/${person.id}`}> | ||
<a>{person.name}</a> | ||
</Link> | ||
</li> | ||
) | ||
export default function Person({ person }) { | ||
return ( | ||
<li> | ||
<Link href="/person/[id]" as={`/person/${person.id}`}> | ||
<a>{person.name}</a> | ||
</Link> | ||
</li> | ||
) | ||
} |
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
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,5 +1,5 @@ | ||
import { people } from '../../../data' | ||
|
||
export default (req, res) => { | ||
export default function handler(req, res) { | ||
res.status(200).json(people) | ||
} |
Oops, something went wrong.