Skip to content

Commit

Permalink
More redundant imports @ examples (vercel#13190)
Browse files Browse the repository at this point in the history
Again, related to [12964](vercel#12964)

After checking all the other examples and the ongoing pull requests, I believe that with this PR being merged, all the examples should be free of redundant react imports.
Let me know if you want me to edit anything that you don't like.

Regards

with-typescript
with-atstroturf
with-atlaskit
with-styletron
with-styled-components-rtl
with-stylesheet
with-stomp
with-stitches-styled
with-stitches
with-slate
with-sentry-simple
with-sentry
with-segment-analytics
with-rematch
with-relay-modern
with-reflux
with-redux-wrapper
with-react-relay-network
with-react-native
with-react-multi-carousel
with-react-jss
with-react-helmet
with-react-ga
with-quill-js
with-prefetching
with-google-analytics-amp
with-google-analytics
with-framer-motion
with-flow
with-firebase-hosting
with-firebase-cloud-messaging
with-firebase-authentication
with-expo
with-dynamic-app-layout
with-draft-js
with-cxs
with-cerebral
with-ant-design-mobile
with-algolia-react-instantsearch
using-preact
progressive-render
  • Loading branch information
todortotev authored and rokinsky committed Jul 11, 2020
1 parent 7433579 commit aaf0eae
Show file tree
Hide file tree
Showing 74 changed files with 34 additions and 94 deletions.
2 changes: 1 addition & 1 deletion examples/progressive-render/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import Loading from '../components/Loading'

function useMounted() {
Expand Down
2 changes: 0 additions & 2 deletions examples/using-preact/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export default function About() {
return <div>About us</div>
}
4 changes: 2 additions & 2 deletions examples/with-algolia-react-instantsearch/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Head, App, findResultsState } from '../components'
import React from 'react'
import { Component } from 'react'
import PropTypes from 'prop-types'
import Router from 'next/router'
import qs from 'qs'
Expand All @@ -9,7 +9,7 @@ const updateAfter = 700
const searchStateToUrl = (searchState) =>
searchState ? `${window.location.pathname}?${qs.stringify(searchState)}` : ''

export default class Home extends React.Component {
export default class Home extends Component {
static propTypes = {
resultsState: PropTypes.object,
searchState: PropTypes.object,
Expand Down
1 change: 0 additions & 1 deletion examples/with-ant-design-mobile/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import App from 'next/app'
import Head from 'next/head'

Expand Down
1 change: 0 additions & 1 deletion examples/with-astroturf/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'astroturf'

const Button = styled('button')`
Expand Down
5 changes: 2 additions & 3 deletions examples/with-atlaskit/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import React from 'react'
import ButtonComponent from '../components/ButtonComponent'
import CheckboxComponent from '../components/CheckboxComponent'
import DateTimePickerComponent from '../components/DateTimePickerComponent'
import DropdownMenuComponent from '../components/DropdownMenuComponent'

export default function Home() {
return (
<React.Fragment>
<>
<ButtonComponent />
<CheckboxComponent />
<DateTimePickerComponent />
<DropdownMenuComponent />
</React.Fragment>
</>
)
}
4 changes: 2 additions & 2 deletions examples/with-cerebral/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import { Component } from 'react'
import { Controller } from 'cerebral'
import Devtools from 'cerebral/devtools'
import { Container } from '@cerebral/react'
import Page from '../components/Page'
import clock from '../modules/clock'

export default class Counter extends React.Component {
export default class Counter extends Component {
constructor(props) {
super(props)
// The controller will be instantiated for every page change and we only
Expand Down
4 changes: 2 additions & 2 deletions examples/with-cerebral/pages/other.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import { Component } from 'react'
import { Controller } from 'cerebral'
import Devtools from 'cerebral/devtools'
import { Container } from '@cerebral/react'
import Page from '../components/Page'
import clock from '../modules/clock'

export default class Counter extends React.Component {
export default class Counter extends Component {
constructor(props) {
super(props)
// The controller will be instantiated for every page change and we only
Expand Down
1 change: 0 additions & 1 deletion examples/with-cxs/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import cxs from 'cxs/lite'

// Using cxs/lite on both the server and client,
Expand Down
6 changes: 3 additions & 3 deletions examples/with-draft-js/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import { Component } from 'react'
import {
Editor,
EditorState,
Expand All @@ -7,7 +7,7 @@ import {
convertFromRaw,
} from 'draft-js'

export default class App extends React.Component {
export default class App extends Component {
constructor(props) {
super(props)
this.state = {
Expand Down Expand Up @@ -240,7 +240,7 @@ const styleMap = {
},
}

class ToolbarButton extends React.Component {
class ToolbarButton extends Component {
constructor() {
super()
this.onToggle = (e) => {
Expand Down
1 change: 0 additions & 1 deletion examples/with-dynamic-app-layout/pages/green.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Link from 'next/link'

import GreenLayout from '../layouts/GreenLayout'
Expand Down
1 change: 0 additions & 1 deletion examples/with-dynamic-app-layout/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Link from 'next/link'

import BlueLayout from '../layouts/BlueLayout'
Expand Down
1 change: 0 additions & 1 deletion examples/with-dynamic-app-layout/pages/red.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Link from 'next/link'

import RedLayout from '../layouts/RedLayout'
Expand Down
1 change: 0 additions & 1 deletion examples/with-emotion-11/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// import App from 'next/app'
import * as React from 'react'
import { CacheProvider } from '@emotion/react'
import { cache } from '@emotion/css'
import { globalStyles } from '../shared/styles'
Expand Down
1 change: 0 additions & 1 deletion examples/with-expo/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @generated: @expo/[email protected]
import React from 'react'
import { StyleSheet, Text, View } from 'react-native'

export default function App() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-firebase-authentication/pages/auth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import FirebaseAuth from '../components/FirebaseAuth'

const Auth = () => {
Expand Down
1 change: 0 additions & 1 deletion examples/with-firebase-authentication/pages/example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Link from 'next/link'

const Example = (props) => {
Expand Down
1 change: 0 additions & 1 deletion examples/with-firebase-authentication/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import PropTypes from 'prop-types'
import { get } from 'lodash/object'
import Link from 'next/link'
Expand Down
2 changes: 1 addition & 1 deletion examples/with-firebase-cloud-messaging/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import { firebaseCloudMessaging } from '../utils/webPush'

class Index extends Component {
Expand Down
1 change: 0 additions & 1 deletion examples/with-firebase-hosting/src/pages/about.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react'
import App from '../components/App'

export default function About() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-firebase-hosting/src/pages/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react'
import App from '../components/App'

export default function Home() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-flow/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from 'next/link'
import React from 'react'

function MyApp({ Component, pageProps }) {
return (
Expand Down
1 change: 0 additions & 1 deletion examples/with-flow/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import React from 'react'
import Page from '../components/Page'

export default function About() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-flow/pages/contact.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import React from 'react'
import Page from '../components/Page'

export default function Contact() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-flow/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import React from 'react'
import Page from '../components/Page'

export default function Home() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-framer-motion/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Gallery from '../components/Gallery'

const Index = () => <Gallery />
Expand Down
1 change: 0 additions & 1 deletion examples/with-google-analytics-amp/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Document, { Main, NextScript } from 'next/document'
import { useAmp } from 'next/amp'

Expand Down
1 change: 0 additions & 1 deletion examples/with-google-analytics-amp/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Page from '../components/Page'

export default function About() {
Expand Down
2 changes: 1 addition & 1 deletion examples/with-google-analytics-amp/pages/contact.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import Page from '../components/Page'

import * as gtag from '../lib/gtag'
Expand Down
1 change: 0 additions & 1 deletion examples/with-google-analytics-amp/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Page from '../components/Page'

export default function Home() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-google-analytics/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'

import { GA_TRACKING_ID } from '../lib/gtag'
Expand Down
1 change: 0 additions & 1 deletion examples/with-google-analytics/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Page from '../components/Page'

export default function About() {
Expand Down
2 changes: 1 addition & 1 deletion examples/with-google-analytics/pages/contact.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import Page from '../components/Page'

import * as gtag from '../lib/gtag'
Expand Down
1 change: 0 additions & 1 deletion examples/with-google-analytics/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Page from '../components/Page'

export default function Home() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-prefetching/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import App from 'next/app'
import React from 'react'
import Nav from '../components/Nav'

export default class MyApp extends App {
Expand Down
1 change: 0 additions & 1 deletion examples/with-quill-js/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import dynamic from 'next/dynamic'

const QuillNoSSRWrapper = dynamic(import('react-quill'), {
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-ga/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import App from 'next/app'
import Router from 'next/router'
import { initGA, logPageView } from '../utils/analytics'
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-helmet/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { Helmet } from 'react-helmet'

function MyApp({ Component, pageProps }) {
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-helmet/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { Helmet } from 'react-helmet'

export default function About() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-intl/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import App from 'next/app'
import React from 'react'
import { createIntl, createIntlCache, RawIntlProvider } from 'react-intl'

// This is optional but highly recommended
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-jss/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Document from 'next/document'
import { SheetsRegistry, JssProvider, createGenerateId } from 'react-jss'

Expand Down
1 change: 0 additions & 1 deletion examples/with-react-jss/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import withStyles from 'react-jss'

const styles = {
Expand Down
2 changes: 0 additions & 2 deletions examples/with-react-multi-carousel/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
This is copy paste from the with-material-ui example.
*/

import React from 'react'
import App from 'next/app'
import Head from 'next/head'
import { MuiThemeProvider } from '@material-ui/core/styles'
Expand Down
4 changes: 2 additions & 2 deletions examples/with-react-multi-carousel/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import { Component } from 'react'
import { withStyles } from '@material-ui/core/styles'
import Carousel from 'react-multi-carousel'

Expand All @@ -15,7 +15,7 @@ const styles = (theme) => ({
},
})

class Index extends React.Component {
class Index extends Component {
render() {
const { classes } = this.props
const images = [
Expand Down
4 changes: 2 additions & 2 deletions examples/with-react-native-web/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Children } from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import React from 'react'
import { AppRegistry } from 'react-native'
import config from '../app.json'
// Force Next-generated DOM elements to fill their parent's height
Expand All @@ -20,7 +20,7 @@ export default class MyDocument extends Document {
<style dangerouslySetInnerHTML={{ __html: normalizeNextElements }} />,
getStyleElement(),
]
return { ...page, styles: React.Children.toArray(styles) }
return { ...page, styles: Children.toArray(styles) }
}

render() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-native-web/pages/alternate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react'
import { StyleSheet, Text, View } from 'react-native'

export default function Alternate() {
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-native-web/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react'
import { StyleSheet, Text, View } from 'react-native'

export default function App(props) {
Expand Down
1 change: 0 additions & 1 deletion examples/with-react-relay-network-modern/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { QueryRenderer, fetchQuery } from 'react-relay'
import NextApp from 'next/app'

Expand Down
2 changes: 1 addition & 1 deletion examples/with-react-relay-network-modern/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import { graphql } from 'react-relay'
import BlogPosts from '../components/BlogPosts'

Expand Down
1 change: 0 additions & 1 deletion examples/with-redux-wrapper/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import App from 'next/app'
import React from 'react'
import { wrapper } from '../store/store'

class WrappedApp extends App {
Expand Down
2 changes: 1 addition & 1 deletion examples/with-redux-wrapper/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import { useEffect } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import Page from '../components/Page'
Expand Down
2 changes: 1 addition & 1 deletion examples/with-redux-wrapper/pages/other.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import { useEffect } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import Page from '../components/Page'
Expand Down
1 change: 0 additions & 1 deletion examples/with-reflux/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Reflux from 'reflux'
import CounterStore from '../store/counterStore'
import Actions from '../actions/actions'
Expand Down
1 change: 0 additions & 1 deletion examples/with-relay-modern/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import withData from '../lib/withData'
import BlogPosts from '../components/BlogPosts'
import indexPageQuery from '../queries/indexPage'
Expand Down
2 changes: 1 addition & 1 deletion examples/with-rematch/pages/github-users.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import Link from 'next/link'
import { connect } from 'react-redux'

Expand Down
2 changes: 1 addition & 1 deletion examples/with-rematch/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import { connect } from 'react-redux'

import Header from '../shared/components/header'
Expand Down
1 change: 0 additions & 1 deletion examples/with-segment-analytics/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import * as snippet from '@segment/snippet'

Expand Down
2 changes: 0 additions & 2 deletions examples/with-segment-analytics/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export default function About() {
return (
<div>
Expand Down
Loading

0 comments on commit aaf0eae

Please sign in to comment.