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/with-rematch/shared/withRematch.js | @@ -18,7 +18,7 @@ function getOrCreateStore(initialState) {
return window[__NEXT_REDUX_STORE__]
}
-export default (App) => {
+export default function withRematch(App) {
return class AppWithRematch extends React.Component {
static async getInitialProps(appContext) {
// Get or Create the store with `... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-segment-analytics/components/Header.js | @@ -1,26 +1,28 @@
import React from 'react'
import Link from 'next/link'
-export default () => (
- <header>
- <nav>
- <ul>
- <li>
- <Link href="/">
- <a>Home</a>
- </Link>
- </li>
- <li>
- <Link href="/about">
- <a>About</a>
- <... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-segment-analytics/pages/_document.js | @@ -8,7 +8,7 @@ const {
NODE_ENV = 'development',
} = process.env
-export default class extends Document {
+export default class MyDocument extends Document {
renderSnippet() {
const opts = {
apiKey: ANALYTICS_WRITE_KEY, | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-segment-analytics/pages/about.js | @@ -1,7 +1,9 @@
import React from 'react'
-export default () => (
- <div>
- <h1>This is the About page</h1>
- </div>
-)
+export default function About() {
+ return (
+ <div>
+ <h1>This is the About page</h1>
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-segment-analytics/pages/contact.js | @@ -1,6 +1,6 @@
import React, { Component } from 'react'
-export default class extends Component {
+export default class Contact extends Component {
state = { message: '' }
render() { | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-segment-analytics/pages/index.js | @@ -1,7 +1,9 @@
import React from 'react'
-export default () => (
- <div>
- <h1>This is the Home page</h1>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ <h1>This is the Home page</h1>
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-semantic-ui/pages/index.js | @@ -3,47 +3,49 @@ import { Modal, Button, Icon } from 'semantic-ui-react'
import SmallImage from './SmallImage.png'
import LargeImage from './LargeImage.png'
-export default () => (
- <div className="centered">
- <Icon size="massive" name="world" />
- <div className="separator" />
- <Modal trigger={<Butto... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-shallow-routing/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/with-static-export/components/post.js | @@ -1,11 +1,13 @@
import Link from 'next/link'
-export default ({ title, body, id }) => (
- <article>
- <h2>{title}</h2>
- <p>{body}</p>
- <Link href="/post/[id]" as={`/post/${id}`}>
- <a>Read more...</a>
- </Link>
- </article>
-)
+export default function Post({ title, body, id }) {
+ return (
+ ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-static-export/pages/post/[id].js | @@ -1,4 +1,3 @@
-import { Component } from 'react'
import Link from 'next/link'
import Head from 'next/head'
@@ -30,24 +29,20 @@ export async function getStaticProps({ params }) {
}
}
-export default class extends Component {
- render() {
- const { title, body } = this.props
+export default function Post(... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-stencil/packages/web-app/pages/index.js | @@ -1,5 +1,7 @@
-export default () => (
- <div>
- <my-component first="Next.js" last="The React Framework"></my-component>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ <my-component first="Next.js" last="The React Framework"></my-component>
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-storybook/components/index.js | @@ -1,2 +1,4 @@
import React from 'react'
-export default () => <div>Hello World</div>
+export default function Home() {
+ return <div>Hello World</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-storybook/pages/index.js | @@ -1,7 +1,10 @@
import HelloWorld from '../components'
-export default () => (
- <div>
- <h1>Simple Storybook Example</h1>
- <HelloWorld />
- </div>
-)
+
+export default function Home() {
+ return (
+ <div>
+ <h1>Simple Storybook Example</h1>
+ <HelloWorld />
+ </div>
+ )
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-strict-csp-hash/pages/_document.js | @@ -7,7 +7,7 @@ const cspHashOf = (text) => {
return `'sha256-${hash.digest('base64')}'`
}
-export default class extends Document {
+export default class MyDocument extends Document {
render() {
const csp = `default-src 'self'; script-src 'self' ${cspHashOf(
NextScript.getInlineScriptSource(this.pr... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-strict-csp-hash/pages/index.js | @@ -1 +1,3 @@
-export default () => <div>Hello World</div>
+export default function Home() {
+ return <div>Hello World</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-strict-csp/pages/index.js | @@ -1 +1,3 @@
-export default () => <div>Hello World</div>
+export default function Home() {
+ return <div>Hello World</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-stripe-typescript/pages/api/checkout_sessions/[id].ts | @@ -6,7 +6,10 @@ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2019-12-03',
})
-export default async (req: NextApiRequest, res: NextApiResponse) => {
+export default async function handler(
+ req: NextApiRequest,
+ res: NextApiResponse
+) {
const id: string = req.query.id as string... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-stripe-typescript/pages/api/checkout_sessions/index.ts | @@ -9,7 +9,10 @@ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2019-12-03',
})
-export default async (req: NextApiRequest, res: NextApiResponse) => {
+export default async function handler(
+ req: NextApiRequest,
+ res: NextApiResponse
+) {
if (req.method === 'POST') {
const a... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-stripe-typescript/pages/api/payment_intents/index.ts | @@ -9,7 +9,10 @@ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2019-12-03',
})
-export default async (req: NextApiRequest, res: NextApiResponse) => {
+export default async function handler(
+ req: NextApiRequest,
+ res: NextApiResponse
+) {
if (req.method === 'POST') {
const {... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-style-sheet/pages/index.js | @@ -2,13 +2,15 @@ import React from 'react'
import { StyleSheet, StyleResolver } from 'style-sheet'
const cls = StyleResolver.resolve
-export default () => (
- <div className={cls([styles.root, styles.color])}>
- <div>
- Hello from <span className={cls(styles.brand)}>Next.js</span>
+export default function... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-styled-components-rtl/pages/index.js | @@ -7,4 +7,6 @@ const Title = styled.h1`
text-align: left;
`
-export default () => <Title>My page</Title>
+export default function Home() {
+ return <Title>My page</Title>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-styled-components/pages/index.js | @@ -5,4 +5,6 @@ const Title = styled.h1`
color: ${({ theme }) => theme.colors.primary};
`
-export default () => <Title>My page</Title>
+export default function Home() {
+ return <Title>My page</Title>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-styled-jsx-plugins/pages/index.js | @@ -1,21 +1,23 @@
-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;
- lost-... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-styled-jsx-scss/pages/index.js | @@ -1,24 +1,26 @@
const backgroundColor = '#eee'
-export default () => (
- <div className="hello">
- <p>Hello World</p>
- <style jsx>{`
- $color: red;
+export default function Home() {
+ return (
+ <div className="hello">
+ <p>Hello World</p>
+ <style jsx>{`
+ $color: red;
- .... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-styletron/pages/index.js | @@ -14,7 +14,7 @@ const SubTitle = styled('h2', ({ $size }) => ({
fontSize: `${$size}px`,
}))
-export default () => {
+export default function Home() {
// an alternative hook based API
const [css] = useStyletron()
return ( | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-typescript-graphql/pages/about.tsx | @@ -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=... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-typescript-styled-components/pages/index.tsx | @@ -1,9 +1,10 @@
-import React from 'react'
import styled from 'styled-components'
const Title = styled.h1`
color: red;
font-size: 50px;
`
-export default () => <Title>My page</Title>
+export default function Home() {
+ return <Title>My page</Title>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-typescript/pages/api/users/index.ts | @@ -1,7 +1,7 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { sampleUserData } from '../../../utils/sample-data'
-export default (_: NextApiRequest, res: NextApiResponse) => {
+const handler = (_: NextApiRequest, res: NextApiResponse) => {
try {
if (!Array.isArray(sampleUserData)) {
... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-typestyle/pages/index.js | @@ -4,4 +4,6 @@ import { style } from 'typestyle'
const className = style({ color: 'red' })
const RedText = ({ text }) => <div className={className}>{text}</div>
-export default () => <RedText text="Hello Next.js!" />
+export default function Home() {
+ return <RedText text="Hello Next.js!" />
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-universal-configuration-build-time/pages/index.js | @@ -1,9 +1,11 @@
-export default () => (
- <div>
- <p>Environment variable process.env.TEST is "{process.env.TEST}"</p>
- <p>
- Custom environment variables process.env.BACKEND_URL is "
- {process.env.BACKEND_URL}"
- </p>
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ <... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-universal-configuration-runtime/pages/index.js | @@ -4,8 +4,6 @@ import getConfig from 'next/config'
const { publicRuntimeConfig } = getConfig()
const { API_URL } = publicRuntimeConfig
-export default class extends React.Component {
- render() {
- return <div>The API_URL is {API_URL}</div>
- }
+export default function Home() {
+ return <div>The API_URL is {... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-webpack-bundle-size-analyzer/pages/contact.js | @@ -1 +1,3 @@
-export default () => <div>This is the contact page.</div>
+export default function Contact() {
+ return <div>This is the contact page.</div>
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-why-did-you-render/pages/_app.js | @@ -5,4 +5,6 @@ if (typeof window !== 'undefined' && process.env.NODE_ENV === 'development') {
whyDidYouRender(React)
}
-export default ({ Component, pageProps }) => <Component {...pageProps} />
+export default function App({ Component, pageProps }) {
+ return <Component {...pageProps} />
+} | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-why-did-you-render/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-xstate/components/Counter.js | @@ -1,10 +1,12 @@
-export default ({ counter = {} }) => (
- <div>
- <h1>
- Count: <span>{counter.count}</span>
- </h1>
- <button onClick={() => counter.decrement()}>-1</button>
- <button onClick={() => counter.increment()}>+1</button>
- <button onClick={() => counter.reset()}>Reset</button>
- </di... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-yarn-workspaces/packages/web-app/pages/index.js | @@ -1,10 +1,12 @@
import foo from 'foo'
import Bar from 'bar'
-export default () => (
- <div>
- Imported modules from another workspace:
- <pre>{foo}</pre>
- <Bar />
- </div>
-)
+export default function Home() {
+ return (
+ <div>
+ Imported modules from another workspace:
+ <pre>{foo}</pre... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-zones/blog/pages/blog/index.js | @@ -1,23 +1,28 @@
import Link from 'next/link'
-export default () => (
- <div>
- <h3>This is our blog</h3>
- <ul>
- <li>
- <Link href="/blog/post/[id]" as="/blog/post/1">
- <a>Post 1</a>
- </Link>
- </li>
- <li>
- <Link href="/blog/post/[id]" as="/blog/post/2">
- ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-zones/blog/pages/blog/post/[id].js | @@ -1,7 +1,7 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
-export default () => {
+export default function Post() {
const router = useRouter()
return (
<div> | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-zones/home/components/Header.js | @@ -1,5 +1,7 @@
-export default () => (
+const Header = () => (
<div>
<h2>The Company</h2>
</div>
)
+
+export default Header | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-zones/home/pages/about.js | @@ -1,6 +1,6 @@
import Link from 'next/link'
-export default () => (
+const About = () => (
<div>
<p>This is the about page.</p>
<div>
@@ -11,3 +11,5 @@ export default () => (
<img width={200} src="/static/zeit.png" />
</div>
)
+
+export default About | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | examples/with-zones/home/pages/index.js | @@ -3,18 +3,20 @@ import dynamic from 'next/dynamic'
const Header = dynamic(import('../components/Header'))
-export default () => (
- <div>
- <Header />
- <p>This is our homepage</p>
+export default function Home() {
+ return (
<div>
- <a href="/blog">Blog</a>
+ <Header />
+ <p>This is ... | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | package.json | @@ -68,6 +68,7 @@
"cross-spawn": "6.0.5",
"escape-string-regexp": "2.0.0",
"eslint": "6.8.0",
+ "eslint-plugin-import": "2.20.2",
"eslint-plugin-jest": "23.13.1",
"eslint-plugin-react": "7.18.0",
"eslint-plugin-react-hooks": "2.3.0", | true |
Other | vercel | next.js | dbad9db68c49f32603b42b2a0f1851abe454cfbf.json | Update Examples for Fast Refresh (#13068) | yarn.lock | @@ -3965,6 +3965,14 @@ array-unique@^0.3.2:
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
+array.prototype.flat@^1.2.1:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/array.prototyp... | true |
Other | vercel | next.js | c334a2751e639e78d1754971315bb4cda838de5b.json | chore: use function component on with-typescript example (#12695) | examples/with-typescript/pages/users/[id].tsx | @@ -11,32 +11,33 @@ type Props = {
errors?: string
}
-export default class StaticPropsDetail extends React.Component<Props> {
- render() {
- const { item, errors } = this.props
-
- if (errors) {
- return (
- <Layout title={`Error | Next.js + TypeScript Example`}>
- <p>
- <sp... | false |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/auth0/pages/about.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
import Layout from '../components/layout'
import { useFetchUser } from '../lib/user'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/auth0/pages/index.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
import Layout from '../components/layout'
import { useFetchUser } from '../lib/user'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/auth0/pages/profile.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
// This import is only needed when checking authentication status directly from getInitialProps
// import auth0 from '../lib/auth0'
import { useFetchUser } from '../lib/user' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/components/Clock.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useSelector, shallowEqual } from 'react-redux'
const useClock = () => { | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/components/Counter.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
const useCounter = () => { | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/components/ErrorMessage.js | @@ -1,4 +1,3 @@
-import React from 'react'
import PropTypes from 'prop-types'
const ErrorMessage = ({ message }) => ( | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/components/Layout.js | @@ -1,4 +1,3 @@
-import React from 'react'
import Nav from './Nav'
import PropTypes from 'prop-types'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/components/PostUpvoter.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useMutation } from '@apollo/react-hooks'
import gql from 'graphql-tag'
import PropTypes from 'prop-types' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/lib/apollo.js | @@ -1,4 +1,3 @@
-import React from 'react'
import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks'
import { ApolloClient } from 'apollo-client' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/lib/redux.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { Provider } from 'react-redux'
import { initializeStore } from '../store'
import App from 'next/app' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/pages/index.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useDispatch } from 'react-redux'
import { withRedux } from '../lib/redux'
import { compose } from 'redux' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo-and-redux/pages/redux.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useDispatch } from 'react-redux'
import { withRedux } from '../lib/redux'
import useInterval from '../lib/useInterval' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo/components/PostUpvoter.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useMutation } from '@apollo/react-hooks'
import gql from 'graphql-tag'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-apollo/lib/apollo.js | @@ -1,4 +1,3 @@
-import React from 'react'
import App from 'next/app'
import Head from 'next/head'
import { ApolloProvider } from '@apollo/react-hooks' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-context-api/components/Counter.js | @@ -1,7 +1,7 @@
-import React, { useReducer, useContext } from 'react'
+import { useReducer, useContext, createContext } from 'react'
-const CounterStateContext = React.createContext()
-const CounterDispatchContext = React.createContext()
+const CounterStateContext = createContext()
+const CounterDispatchContext = cr... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-context-api/pages/about.js | @@ -1,4 +1,3 @@
-import React from 'react'
import Link from 'next/link'
import { useCount, useDispatchCount } from '../components/Counter'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-context-api/pages/index.js | @@ -1,4 +1,3 @@
-import React from 'react'
import Link from 'next/link'
import { useCount, useDispatchCount } from '../components/Counter'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-docker/pages/index.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
export default () => {
return <h1>Hello World!</h1>
} | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-emotion/pages/_app.js | @@ -1,4 +1,3 @@
-import * as React from 'react'
import NextApp from 'next/app'
import { CacheProvider } from '@emotion/core'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-observable/components/CharacterInfo.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { connect } from 'react-redux'
const CharacterInfo = ({ | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-observable/pages/_app.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { Provider } from 'react-redux'
import App from 'next/app'
import withRedux from 'next-redux-wrapper' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-observable/pages/index.js | @@ -1,4 +1,4 @@
-import React from 'react'
+import { Component } from 'react'
import Link from 'next/link'
import { of, Subject } from 'rxjs'
import { StateObservable } from 'redux-observable'
@@ -7,7 +7,7 @@ import CharacterInfo from '../components/CharacterInfo'
import { rootEpic } from '../redux/epics'
import *... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-observable/pages/other.js | @@ -1,4 +1,3 @@
-import React from 'react'
import Link from 'next/link'
const OtherPage = () => ( | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-persist/components/counter.js | @@ -1,4 +1,4 @@
-import React, { Component } from 'react'
+import { Component } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { incrementCount, decrementCount, resetCount } from '../store' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-persist/components/data-list.js | @@ -1,4 +1,4 @@
-import React, { Component } from 'react'
+import { Component } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import { loadExampleData, loadingExampleDataFailure } from '../store' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-persist/lib/with-redux-store.js | @@ -1,4 +1,4 @@
-import React from 'react'
+import { Component } from 'react'
import { initializeStore } from '../store'
const isServer = typeof window === 'undefined'
@@ -18,7 +18,7 @@ function getOrCreateStore(initialState) {
}
export default App => {
- return class AppWithRedux extends React.Component {
+ ... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-persist/pages/_app.js | @@ -1,5 +1,4 @@
import App from 'next/app'
-import React from 'react'
import withReduxStore from '../lib/with-redux-store'
import { Provider } from 'react-redux'
import { persistStore } from 'redux-persist' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-persist/pages/index.js | @@ -1,9 +1,9 @@
-import React from 'react'
+import { Component } from 'react'
import { connect } from 'react-redux'
import { startClock, serverRenderClock } from '../store'
import Examples from '../components/examples'
-class Index extends React.Component {
+class Index extends Component {
static getInitialProp... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-saga/components/clock.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
const pad = n => (n < 10 ? `0${n}` : n)
const format = t => { | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-saga/components/counter.js | @@ -1,4 +1,4 @@
-import React, { Component } from 'react'
+import { Component } from 'react'
import { connect } from 'react-redux'
import { increment, decrement, reset } from '../actions' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-saga/pages/_app.js | @@ -1,5 +1,4 @@
import App from 'next/app'
-import React from 'react'
import { Provider } from 'react-redux'
import withRedux from 'next-redux-wrapper'
import withReduxSaga from 'next-redux-saga' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-saga/pages/index.js | @@ -1,10 +1,10 @@
-import React from 'react'
+import { Component } from 'react'
import { connect } from 'react-redux'
import { loadData, startClock, tickClock } from '../actions'
import Page from '../components/page'
-class Index extends React.Component {
+class Index extends Component {
static async getIniti... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-saga/pages/other.js | @@ -1,10 +1,10 @@
-import React from 'react'
+import { Component } from 'react'
import { connect } from 'react-redux'
import { startClock, tickClock } from '../actions'
import Page from '../components/page'
-class Other extends React.Component {
+class Other extends Component {
static async getInitialProps(pr... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/components/clock.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
const pad = n => (n < 10 ? `0${n}` : n)
const format = t => | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/components/counter.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { incrementCount, decrementCount, resetCount } from '../actions'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/components/examples.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useSelector } from 'react-redux'
import Clock from './clock'
import Counter from './counter' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/lib/with-redux-store.js | @@ -1,4 +1,4 @@
-import React from 'react'
+import { Component } from 'react'
import initializeStore from '../store'
const __NEXT_REDUX_STORE__ = '__NEXT_REDUX_STORE__'
@@ -17,7 +17,7 @@ function getOrCreateStore(initialState) {
}
export default App => {
- return class AppWithRedux extends React.Component {
+ ... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/pages/_app.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { Provider } from 'react-redux'
import App from 'next/app'
import withReduxStore from '../lib/with-redux-store' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/pages/index.js | @@ -1,4 +1,4 @@
-import React, { PureComponent } from 'react'
+import { PureComponent } from 'react'
import { connect } from 'react-redux'
import Link from 'next/link'
import { startClock, serverRenderClock } from '../actions' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-thunk/pages/show-redux-state.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { connect } from 'react-redux'
import Link from 'next/link'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-toolkit/components/clock.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useSelector, shallowEqual } from 'react-redux'
const useClock = () => { | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-toolkit/components/counter.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { createAction } from '@reduxjs/toolkit'
import { useSelector, useDispatch } from 'react-redux'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-toolkit/pages/_app.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { Provider } from 'react-redux'
import { store } from '../store'
| true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-redux-toolkit/pages/index.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { createAction } from '@reduxjs/toolkit'
import { connect } from 'react-redux'
import useInterval from '../lib/useInterval' | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-styled-components/README.md | @@ -58,7 +58,6 @@ When wrapping a [Link](https://nextjs.org/docs/api-reference/next/link) from `ne
**components/StyledLink.js**
```javascript
-import React from 'react'
import Link from 'next/link'
import styled from 'styled-components'
@@ -88,7 +87,6 @@ export default styled(StyledLink)`
**pages/index.js**
... | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-styled-components/pages/_app.js | @@ -1,5 +1,4 @@
import App from 'next/app'
-import React from 'react'
import { ThemeProvider } from 'styled-components'
const theme = { | true |
Other | vercel | next.js | dd264f582f547508b5b5af2cf1dc665a9c53f8e5.json | chore: Remove redundant imports in several examples (#13030) | examples/with-styled-components/pages/index.js | @@ -1,4 +1,3 @@
-import React from 'react'
import styled from 'styled-components'
const Title = styled.h1` | true |
Other | vercel | next.js | f5c8b428ab3975f75461e9d50155bf5344531974.json | Stabilize test for Windows (#13050) | test/integration/getserversideprops/test/index.test.js | @@ -387,8 +387,13 @@ const runTests = (dev = false) => {
await waitFor(500)
await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-post').click()
- await waitFor(1000)
- expect(await browser.eval('window.beforeClick')).not.toBe('abc')
+ expect(
+ await check(()... | true |
Other | vercel | next.js | f5c8b428ab3975f75461e9d50155bf5344531974.json | Stabilize test for Windows (#13050) | test/integration/prerender/test/index.test.js | @@ -382,8 +382,13 @@ const runTests = (dev = false, looseMode = false) => {
const browser = await webdriver(appPort, '/')
await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-post').click()
- await waitFor(1000)
- expect(await browser.eval('window.beforeClick')).not.... | true |
Other | vercel | next.js | 73eb9cede5ed09eaee39f1da3d899792bc6ab84e.json | Convert test to be inline (#13022) | test/unit/__snapshots__/page-route-sorter.test.js.snap | @@ -1,22 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`getSortedRoutes correctly sorts required slugs 1`] = `
-Array [
- "/",
- "/apples/[ab]/[cd]/ef",
- "/blog/abc",
- "/blog/abc/post",
- "/blog/abc/[id]",
- "/blog/[id]",
- "/blog/[id]/comments/[cid]",
- "/foo/[d]/bar/baz/[f]",
- "/p/[...res... | true |
Other | vercel | next.js | 73eb9cede5ed09eaee39f1da3d899792bc6ab84e.json | Convert test to be inline (#13022) | test/unit/page-route-sorter.test.js | @@ -36,7 +36,26 @@ describe('getSortedRoutes', () => {
'/foo/[d]/bar/baz/[f]',
'/apples/[ab]/[cd]/ef',
])
- ).toMatchSnapshot()
+ ).toMatchInlineSnapshot(`
+ Array [
+ "/",
+ "/apples/[ab]/[cd]/ef",
+ "/blog/abc",
+ "/blog/abc/post",
+ "/blog/abc/[i... | true |
Other | vercel | next.js | fedc662f259915bac5c312a4254e2d8b7e8b4223.json | feat: Remove redundant imports in XState example (#13020) | examples/with-xstate/components/Toggle.js | @@ -1,5 +1,3 @@
-import React from 'react'
-
const Toggle = ({ onToggle, active }) => {
return (
<div> | true |
Other | vercel | next.js | fedc662f259915bac5c312a4254e2d8b7e8b4223.json | feat: Remove redundant imports in XState example (#13020) | examples/with-xstate/pages/index.js | @@ -1,4 +1,3 @@
-import React from 'react'
import { useMachine } from '@xstate/react'
import { Counter, Toggle } from '../components'
import { toggleMachine } from '../machines/toggleMachine' | true |
Other | vercel | next.js | c2f8046f9b6be4fb0aaa707e691dc604b223975a.json | fix modal overlay in RTL layouts (#13000) | packages/react-dev-overlay/src/internal/styles/CssReset.tsx | @@ -8,6 +8,9 @@ export function CssReset() {
__html: css`
:host {
all: initial;
+
+ /* the direction property is not reset by 'all' */
+ direction: ltr;
}
/*! | false |
Other | vercel | next.js | c239c746294495586fdf710266a7c3a78e09f199.json | Use a top level heading (#12960) | docs/advanced-features/module-path-aliases.md | @@ -2,7 +2,7 @@
description: Configure module path aliases that allow you to remap certain import paths.
---
-## Absolute Imports and Module path aliases
+# Absolute Imports and Module path aliases
Next.js automatically supports the `tsconfig.json` and `jsconfig.json` `"paths"` and `"baseUrl"` options.
| false |
Other | vercel | next.js | 7be3b1014883e4c9c8cf4ad24776020c8d03fd69.json | Add experimental Storybook preset (#12934) | packages/next-plugin-storybook/package.json | @@ -0,0 +1,11 @@
+{
+ "name": "@next/plugin-storybook",
+ "version": "9.4.1-canary.7",
+ "repository": {
+ "url": "zeit/next.js",
+ "directory": "packages/next-plugin-storybook"
+ },
+ "peerDependencies": {
+ "next": "*"
+ }
+} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.