language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/basic-css/pages/index.js | @@ -1,17 +1,19 @@
-export default () => (
- <div className="hello">
- <p>Hello World</p>
- <style jsx>{`
- .hello {
- font: 15px Helvetica, Arial, sans-serif;
- background: #eee;
- padding: 100px;
- text-align: center;
- transition: 100ms ease-in background;
- }
- ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/basic-export/pages/about.js | @@ -1 +1,3 @@
-export default () => <div>About us</div>
+export default function About() {
+ return <div>About us</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/basic-export/pages/about2.js | @@ -1 +1,3 @@
-export default () => <div>About 2</div>
+export default function About2() {
+ return <div>About 2</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/basic-export/pages/day/index.js | @@ -1 +1,3 @@
-export default () => <div>Hello Day</div>
+export default function Day() {
+ return <div>Hello Day</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/basic-export/pages/index.js | @@ -1,9 +1,11 @@
import Link from 'next/link'
-export default () => (
- <div>
- Hello World.{' '}
- <Link href="/about">
- <a>About</a>
- </Link>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ Hello World.{' '}
+ <Link href="/about">
+ <a>About</a>
+ </Link... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-contentful/components/date.js | @@ -1,7 +1,9 @@
import { format } from 'date-fns'
-export default ({ dateString }) => (
- <time dateTime={dateString}>
- {format(new Date(dateString), 'LLLL d, yyyy')}
- </time>
-)
+export default function Date({ dateString }) {
+ return (
+ <time dateTime={dateString}>
+ {format(new Date(dateString), ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-contentful/pages/api/exit-preview.js | @@ -1,4 +1,4 @@
-export default async (_, res) => {
+export default async function exit(_, res) {
// Exit the current user from "Preview Mode". This function accepts no args.
res.clearPreviewData()
| true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-contentful/pages/api/preview.js | @@ -1,6 +1,6 @@
import { getPreviewPostBySlug } from '../../lib/api'
-export default async (req, res) => {
+export default async function preview(req, res) {
const { secret, slug } = req.query
if ( | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-datocms/pages/api/exit-preview.js | @@ -1,4 +1,4 @@
-export default async (_, res) => {
+export default async function exit(_, res) {
// Exit the current user from "Preview Mode". This function accepts no args.
res.clearPreviewData()
| true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-datocms/pages/api/preview.js | @@ -1,6 +1,6 @@
import { getPreviewPostBySlug } from '../../lib/api'
-export default async (req, res) => {
+export default async function preview(req, res) {
// Check the secret and next parameters
// This secret should only be known to this API route and the CMS
if ( | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-prismic/pages/api/exit-preview.js | @@ -1,4 +1,4 @@
-export default async (_, res) => {
+export default async function exit(_, res) {
// Exit the current user from "Preview Mode". This function accepts no args.
res.clearPreviewData()
| true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-prismic/pages/api/preview.js | @@ -10,7 +10,7 @@ function linkResolver(doc) {
return `/${doc.uid}`
}
-export default async (req, res) => {
+export default async function preview(req, res) {
const ref = req.query.token
// Check the token parameter against the Prismic SDK | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-sanity/pages/api/exit-preview.js | @@ -1,4 +1,4 @@
-export default async (_, res) => {
+export default async function exit(_, res) {
// Exit the current user from "Preview Mode". This function accepts no args.
res.clearPreviewData()
| true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-sanity/pages/api/preview.js | @@ -1,6 +1,6 @@
import { getPreviewPostBySlug } from '../../lib/api'
-export default async (req, res) => {
+export default async function preview(req, res) {
// Check the secret and next parameters
// This secret should only be known to this API route and the CMS
if ( | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-takeshape/pages/api/exit-preview.js | @@ -1,4 +1,4 @@
-export default async (_, res) => {
+export default async function exit(_, res) {
// Exit the current user from "Preview Mode". This function accepts no args.
res.clearPreviewData()
| true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/cms-takeshape/pages/api/preview.js | @@ -1,6 +1,6 @@
import { getPreviewPostBySlug } from '../../lib/api'
-export default async (req, res) => {
+export default async function preview(req, res) {
// Check the secret and next parameters
// This secret should only be known to this API route and the CMS
if ( | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-actionhero/pages/a.js | @@ -1 +1,3 @@
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-actionhero/pages/b.js | @@ -1 +1,3 @@
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-actionhero/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-express/pages/a.js | @@ -1 +1,3 @@
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-express/pages/b.js | @@ -1 +1,3 @@
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-express/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-fastify/pages/a.js | @@ -1 +1,3 @@
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-fastify/pages/b.js | @@ -1 +1,3 @@
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-fastify/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-hapi/pages/a.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-hapi/pages/b.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-hapi/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-koa/pages/a.js | @@ -1 +1,3 @@
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-koa/pages/b.js | @@ -1 +1,3 @@
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-koa/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-polka/pages/a.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-polka/pages/b.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-polka/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-typescript/pages/a.tsx | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-typescript/pages/b.tsx | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server-typescript/pages/index.tsx | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/a" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/b" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server/pages/a.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>a</div>
+export default function A() {
+ return <div>a</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server/pages/b.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>b</div>
+export default function B() {
+ return <div>b</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/custom-server/pages/index.js | @@ -1,17 +1,19 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/b" as="/a">
- <a>a</a>
- </Link>
- </li>
- <li>
- <Link href="/a" as="/b">
- <a>b</a>
- </Link>
- </li>
- </ul>
-)
+export default function Ho... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/gh-pages/pages/about.js | @@ -1,12 +1,14 @@
import Link from 'next/link'
-export default () => (
- <div>
- <div>About us</div>
+export default function About() {
+ return (
<div>
- Back to{' '}
- <Link href="/" as={process.env.BACKEND_URL + '/'}>
- <a>Home</a>
- </Link>
+ <div>About us</div>
+ <div>
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/gh-pages/pages/index.js | @@ -1,9 +1,11 @@
import Link from 'next/link'
-export default () => (
- <div>
- Hello World.{' '}
- <Link href="/about" as={process.env.BACKEND_URL + '/about'}>
- <a>About</a>
- </Link>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ Hello World.{' '}
+ <Link href="/abo... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/head-elements/pages/index.js | @@ -1,13 +1,15 @@
import Head from 'next/head'
-export default () => (
- <div>
- <Head>
- <title>This page has a title 🤔</title>
- <meta charSet="utf-8" />
- <meta name="viewport" content="initial-scale=1.0, width=device-width" />
- </Head>
+export default function Home() {
+ return (
+ <d... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/layout-component/components/layout.js | @@ -1,31 +1,36 @@
import Link from 'next/link'
import Head from 'next/head'
-export default ({ children, title = 'This is the default title' }) => (
- <div>
- <Head>
- <title>{title}</title>
- <meta charSet="utf-8" />
- <meta name="viewport" content="initial-scale=1.0, width=device-width" />
- ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/layout-component/pages/about.js | @@ -1,7 +1,9 @@
import Layout from '../components/layout'
-export default () => (
- <Layout title="About us">
- <div>About us</div>
- </Layout>
-)
+export default function About() {
+ return (
+ <Layout title="About us">
+ <div>About us</div>
+ </Layout>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/layout-component/pages/contact.js | @@ -1,7 +1,9 @@
import Layout from '../components/layout'
-export default () => (
- <Layout title="Contact us">
- <div>Contact</div>
- </Layout>
-)
+export default function Contact() {
+ return (
+ <Layout title="Contact us">
+ <div>Contact</div>
+ </Layout>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/layout-component/pages/index.js | @@ -1,7 +1,9 @@
import Layout from '../components/layout'
-export default () => (
- <Layout>
- <div>Hello World.</div>
- </Layout>
-)
+export default function Home() {
+ return (
+ <Layout>
+ <div>Hello World.</div>
+ </Layout>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/nested-components/components/paragraph.js | @@ -1,11 +1,13 @@
-export default ({ children }) => (
- <p>
- {children}
- <style jsx>{`
- p {
- font: 13px Helvetica, Arial;
- margin: 10px 0;
- }
- `}</style>
- </p>
-)
+export default function Paragraph({ children }) {
+ return (
+ <p>
+ {children}
+ <style jsx>{`
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/nested-components/components/post.js | @@ -1,19 +1,21 @@
-export default ({ title, children }) => (
- <div className="main">
- <h1>{title}</h1>
- {children}
- <style jsx>{`
- .main {
- font: 15px Helvetica, Arial;
- border: 1px solid #eee;
- padding: 0 10px;
- }
+export default function Post({ title, children }) {
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/nested-components/pages/index.js | @@ -1,45 +1,47 @@
import P from '../components/paragraph'
import Post from '../components/post'
-export default () => (
- <div className="main">
- <Post title="My first blog post">
- <P>Hello there</P>
- <P>This is an example of a componentized blog post</P>
- </Post>
-
- <hr />
-
- <Post tit... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/progressive-render/components/Loading.js | @@ -1,15 +1,17 @@
import React from 'react'
-export default () => (
- <div>
- <h3>Loading...</h3>
- <style jsx>{`
- div {
- align-items: center;
- display: flex;
- height: 50vh;
- justify-content: center;
- }
- `}</style>
- </div>
-)
+export default function Loading()... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/ssr-caching/pages/blog/[id].js | @@ -1,6 +1,6 @@
import React from 'react'
-export default function (props) {
+export default function Post(props) {
return (
<div>
<h1>My {props.id} blog post</h1> | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/ssr-caching/pages/index.js | @@ -1,21 +1,23 @@
import Link from 'next/link'
-export default () => (
- <ul>
- <li>
- <Link href="/blog?id=first" as="/blog/first">
- <a>My first blog post</a>
- </Link>
- </li>
- <li>
- <Link href="/blog?id=second" as="/blog/second">
- <a>My second blog post</a>
- </Link... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/svg-components/pages/index.js | @@ -1,15 +1,17 @@
import React from 'react'
import Cat from '../svgs/cat.svg'
-export default () => (
- <div className="container">
- <marquee>SVG Cat!</marquee>
- <Cat />
- <style jsx>{`
- .container {
- width: 600px;
- margin: 100px auto;
- }
- `}</style>
- </div>
-)
+export ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/using-preact/pages/about.js | @@ -1,3 +1,5 @@
import React from 'react'
-export default () => <div>About us</div>
+export default function About() {
+ return <div>About us</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/using-preact/pages/index.js | @@ -1,11 +1,13 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <div>
- Hello World.{' '}
- <Link href="/about">
- <a>About</a>
- </Link>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ Hello World.{' '}
+ <Link href="/about">
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/using-router/components/Header.js | @@ -1,11 +1,13 @@
import { useRouter } from 'next/router'
-export default () => (
- <div>
- <Link href="/">Home</Link>
- <Link href="/about">About</Link>
- </div>
-)
+export default function Header() {
+ return (
+ <div>
+ <Link href="/">Home</Link>
+ <Link href="/about">About</Link>
+ </div... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/using-router/pages/about.js | @@ -1,8 +1,10 @@
import Header from '../components/header'
-export default () => (
- <div>
- <Header />
- <p>This is the about page.</p>
- </div>
-)
+export default function About() {
+ return (
+ <div>
+ <Header />
+ <p>This is the about page.</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/using-router/pages/index.js | @@ -1,8 +1,10 @@
import Header from '../components/header'
-export default () => (
- <div>
- <Header />
- <p>HOME PAGE is here!</p>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ <Header />
+ <p>HOME PAGE is here!</p>
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-absolute-imports/components/header.js | @@ -1,5 +1,7 @@
-export default () => (
- <header>
- <h1>Hello world!</h1>
- </header>
-)
+export default function Header() {
+ return (
+ <header>
+ <h1>Hello world!</h1>
+ </header>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-absolute-imports/pages/index.js | @@ -1,7 +1,9 @@
import Header from 'components/header.js'
-export default () => (
- <div>
- <Header />
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ <Header />
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-algolia-react-instantsearch/components/app.js | @@ -37,7 +37,7 @@ HitComponent.propTypes = {
hit: PropTypes.object,
}
-export default class extends React.Component {
+export default class App extends React.Component {
static propTypes = {
searchState: PropTypes.object,
resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-algolia-react-instantsearch/pages/index.js | @@ -9,7 +9,7 @@ const updateAfter = 700
const searchStateToUrl = (searchState) =>
searchState ? `${window.location.pathname}?${qs.stringify(searchState)}` : ''
-export default class extends React.Component {
+export default class Home extends React.Component {
static propTypes = {
resultsState: PropTypes.... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-less/pages/index.js | @@ -11,64 +11,78 @@ import {
const FormItem = Form.Item
const Option = Select.Option
-export default () => (
- <div style={{ marginTop: 100 }}>
- <Form layout="horizontal">
- <FormItem
- label="Input Number"
- labelCol={{ span: 8 }}
- wrapperCol={{ span: 8 }}
- >
- <InputNu... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-mobile/pages/about.js | @@ -2,10 +2,12 @@ import Layout from '../components/Layout'
import { Button } from 'antd-mobile'
import Link from 'next/link'
-export default () => (
- <Layout title="About">
- <Link href="/">
- <Button>Go to Index</Button>
- </Link>
- </Layout>
-)
+export default function About() {
+ return (
+ <L... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-mobile/pages/index.js | @@ -2,10 +2,12 @@ import Layout from '../components/Layout'
import { Button } from 'antd-mobile'
import Link from 'next/link'
-export default () => (
- <Layout title="Index">
- <Link href="/about">
- <Button>Go to About</Button>
- </Link>
- </Layout>
-)
+export default function Home() {
+ return (
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-pro-layout-less/layouts/main.tsx | @@ -56,13 +56,15 @@ const menuItemRender = (options: MenuDataItem, element: React.ReactNode) => (
</Link>
)
-export default ({ children }) => (
- <ProLayout
- style={{ minHeight: '100vh' }}
- route={ROUTES}
- menuItemRender={menuItemRender}
- menuHeaderRender={menuHeaderRender}
- >
- {children}
-... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-pro-layout-less/pages/example.tsx | @@ -1,3 +1,5 @@
import MainLayout from '../layouts/main'
-export default () => <MainLayout>Example page</MainLayout>
+export default function Example() {
+ return <MainLayout>Example page</MainLayout>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-pro-layout-less/pages/index.tsx | @@ -13,59 +13,73 @@ import MainLayout from '../layouts/main'
const FormItem = Form.Item
const Option = Select.Option
-export default () => (
- <MainLayout>
- <Form layout="horizontal">
- <FormItem
- label="Input Number"
- labelCol={{ span: 8 }}
- wrapperCol={{ span: 8 }}
- >
- ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design-pro-layout-less/pages/welcome.tsx | @@ -1,3 +1,5 @@
import MainLayout from '../layouts/main'
-export default () => <MainLayout>Welcome!</MainLayout>
+export default function Welcome() {
+ return <MainLayout>Welcome!</MainLayout>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-ant-design/pages/index.js | @@ -15,86 +15,91 @@ const content = {
marginTop: '100px',
}
-export default () => (
- <div style={content}>
- <div className="text-center mb-5">
- <Link href="#">
- <a className="logo mr-0">
- <SmileFilled size={48} strokeWidth={1} />
- </a>
- </Link>
+export default function ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-aphrodite/pages/index.js | @@ -8,11 +8,13 @@ if (typeof window !== 'undefined') {
StyleSheet.rehydrate(window.__NEXT_DATA__.ids)
}
-export default () => (
- <div className={css(styles.root)}>
- <h1 className={css(styles.title)}>My page</h1>
- </div>
-)
+export default function Home() {
+ return (
+ <div className={css(styles.root)... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-apollo/components/App.js | @@ -1,45 +1,47 @@
-export default ({ children }) => (
- <main>
- {children}
- <style jsx global>{`
- * {
- font-family: Menlo, Monaco, 'Lucida Console', 'Liberation Mono',
- 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New',
- monospace, serif;
- }
- body {
- ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-apollo/components/ErrorMessage.js | @@ -1,13 +1,15 @@
-export default ({ message }) => (
- <aside>
- {message}
- <style jsx>{`
- aside {
- padding: 1.5em;
- font-size: 14px;
- color: white;
- background-color: red;
- }
- `}</style>
- </aside>
-)
+export default function ErrorMessage({ message }) {
+ retur... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-app-layout/pages/_app.js | @@ -2,8 +2,10 @@ import React from 'react'
const Layout = ({ children }) => <div className="layout">{children}</div>
-export default ({ Component, pageProps }) => (
- <Layout>
- <Component {...pageProps} />
- </Layout>
-)
+export default function App({ Component, pageProps }) {
+ return (
+ <Layout>
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-app-layout/pages/index.js | @@ -1,3 +1,3 @@
-export default () => {
+export default function Home() {
return <div>test</div>
} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-atlaskit/components/ButtonComponent.js | @@ -1,7 +1,7 @@
import React from 'react'
import Button, { ButtonGroup } from '@atlaskit/button'
-export default () => {
+export default function ButtonComponent() {
return (
<React.Fragment>
<Button style={{ margin: 10 }}>Button</Button> | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-atlaskit/components/CheckboxComponent.js | @@ -1,7 +1,7 @@
import React from 'react'
import { Checkbox } from '@atlaskit/checkbox'
-export default () => {
+export default function CheckboxComponent() {
return (
<React.Fragment>
<Checkbox | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-atlaskit/components/DateTimePickerComponent.js | @@ -6,7 +6,7 @@ import {
} from '@atlaskit/datetime-picker'
import { Label } from '@atlaskit/field-base'
-export default () => {
+export default function DateTimePickerComponent() {
return (
<React.Fragment>
<Label label="TimePicker - timeFormat (h:mm a)" /> | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-atlaskit/components/DropdownMenuComponent.js | @@ -5,7 +5,7 @@ import DropdownMenu, {
} from '@atlaskit/dropdown-menu'
import { Label } from '@atlaskit/field-base'
-export default () => {
+export default function DropdownMenuComponent() {
return (
<React.Fragment>
<Label label="DropdownMenu" /> | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-atlaskit/pages/index.js | @@ -4,7 +4,7 @@ import CheckboxComponent from '../components/CheckboxComponent'
import DateTimePickerComponent from '../components/DateTimePickerComponent'
import DropdownMenuComponent from '../components/DropdownMenuComponent'
-export default () => {
+export default function Home() {
return (
<React.Fragme... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cerebral/components/Clock.js | @@ -1,4 +1,4 @@
-export default (props) => {
+export default function Clock(props) {
return (
<div className={props.light ? 'light' : ''}>
{format(new Date(props.lastUpdate))} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cerebral/modules/clock/provider.js | @@ -2,7 +2,7 @@
const SECOND = 1000
let timer = null
-export default (context) => {
+export default function provider(context) {
context.clock = {
start(signalPath) {
const signal = context.controller.getSignal(signalPath) | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cookie-auth-fauna/pages/api/login.js | @@ -1,7 +1,7 @@
import { query as q } from 'faunadb'
import { serverClient, serializeFaunaCookie } from '../../utils/fauna-auth'
-export default async (req, res) => {
+export default async function login(req, res) {
const { email, password } = await req.body
try { | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cookie-auth-fauna/pages/api/logout.js | @@ -2,7 +2,7 @@ import { query as q } from 'faunadb'
import cookie from 'cookie'
import { faunaClient, FAUNA_SECRET_COOKIE } from '../../utils/fauna-auth'
-export default async (req, res) => {
+export default async function logout(req, res) {
const cookies = cookie.parse(req.headers.cookie ?? '')
const faunaS... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cookie-auth-fauna/pages/api/profile.js | @@ -7,7 +7,7 @@ export const profileApi = async (faunaSecret) => {
return ref.id
}
-export default async (req, res) => {
+export default async function profile(req, res) {
const cookies = cookie.parse(req.headers.cookie ?? '')
const faunaSecret = cookies[FAUNA_SECRET_COOKIE]
| true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cookie-auth-fauna/pages/api/signup.js | @@ -1,7 +1,7 @@
import { query as q } from 'faunadb'
import { serverClient, serializeFaunaCookie } from '../../utils/fauna-auth'
-export default async (req, res) => {
+export default async function signuo(req, res) {
const { email, password } = await req.body
try { | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-cxs/pages/index.js | @@ -9,11 +9,13 @@ if (typeof window !== 'undefined') {
cxs.rehydrate(serverCss)
}
-export default () => (
- <div className={cx.root}>
- <h1 className={cx.title}>My page</h1>
- </div>
-)
+export default function Home() {
+ return (
+ <div className={cx.root}>
+ <h1 className={cx.title}>My page</h1>
+... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-docker/pages/index.js | @@ -1,4 +1,4 @@
-export default () => {
+export default function Home() {
return (
<>
<h1>Hello World!</h1> | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dotenv/pages/index.js | @@ -1 +1,3 @@
-export default () => <div>{process.env.TEST_VAR}</div>
+export default function Home() {
+ return <div>{process.env.TEST_VAR}</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-app-layout/layouts/BlueLayout.js | @@ -1,3 +1,3 @@
-export default ({ children }) => {
+export default function BlueLayout({ children }) {
return <main style={{ border: '4px dashed blue' }}>{children}</main>
} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-app-layout/layouts/GreenLayout.js | @@ -1,3 +1,3 @@
-export default ({ children }) => {
+export default function GreenLayout({ children }) {
return <main style={{ border: '4px dashed green' }}>{children}</main>
} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-app-layout/layouts/RedLayout.js | @@ -1,3 +1,3 @@
-export default ({ children }) => {
+export default function RedLayout({ children }) {
return <main style={{ border: '4px dashed red' }}>{children}</main>
} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-import/components/Header.js | @@ -1,16 +1,18 @@
import Link from 'next/link'
-export default () => (
- <div>
- <Link href="/">
- <a style={styles.a}>Home</a>
- </Link>
+export default function Header() {
+ return (
+ <div>
+ <Link href="/">
+ <a style={styles.a}>Home</a>
+ </Link>
- <Link href="/about">
- ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-import/components/hello1.js | @@ -1 +1,3 @@
-export default () => <p>Hello World 1 (imported dynamically) </p>
+export default function Hello1() {
+ return <p>Hello World 1 (imported dynamically) </p>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-import/components/hello2.js | @@ -1 +1,3 @@
-export default () => <p>Hello World 2 (imported dynamically) </p>
+export default function Hello2() {
+ return <p>Hello World 2 (imported dynamically) </p>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-import/components/hello3.js | @@ -1 +1,3 @@
-export default () => <p>Hello World 3 (imported dynamically) </p>
+export default function Hello3() {
+ return <p>Hello World 3 (imported dynamically) </p>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-import/components/hello4.js | @@ -1 +1,3 @@
-export default () => <p>Hello World 4 (imported dynamically) </p>
+export default function Hello4() {
+ return <p>Hello World 4 (imported dynamically) </p>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-dynamic-import/components/hello5.js | @@ -1 +1,3 @@
-export default () => <p>Hello World 5 (imported dynamically) </p>
+export default function Hello5() {
+ return <p>Hello World 5 (imported dynamically) </p>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-electron/renderer/pages/index.js | @@ -1,6 +1,6 @@
import { Component } from 'react'
-export default class extends Component {
+export default class Home extends Component {
state = {
input: '',
message: null, | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.