diff --git a/examples/with-ant-design/pages/_app.js b/examples/with-ant-design/pages/_app.js index 945d8e1032d69..5dc47adb7e922 100644 --- a/examples/with-ant-design/pages/_app.js +++ b/examples/with-ant-design/pages/_app.js @@ -1,5 +1,3 @@ -import React from 'react' - import 'antd/dist/antd.css' import '../styles/vars.css' import '../styles/global.css' diff --git a/examples/with-dynamic-import/pages/index.js b/examples/with-dynamic-import/pages/index.js index 7ba740a0a5613..2461e6d5b0744 100644 --- a/examples/with-dynamic-import/pages/index.js +++ b/examples/with-dynamic-import/pages/index.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import { useState } from 'react' import Header from '../components/Header' import dynamic from 'next/dynamic' @@ -6,17 +6,12 @@ const DynamicComponent1 = dynamic(() => import('../components/hello1')) const DynamicComponent2WithCustomLoading = dynamic( () => import('../components/hello2'), - { - loading: () =>

Loading caused by client page transition ...

, - } + { loading: () =>

Loading caused by client page transition ...

} ) const DynamicComponent3WithNoSSR = dynamic( () => import('../components/hello3'), - { - loading: () =>

Loading ...

, - ssr: false, - } + { loading: () =>

Loading ...

, ssr: false } ) const DynamicComponent4 = dynamic(() => import('../components/hello4')) @@ -25,6 +20,7 @@ const DynamicComponent5 = dynamic(() => import('../components/hello5')) const IndexPage = () => { const [showMore, setShowMore] = useState(false) + const [falsyField] = useState(false) return (
@@ -40,7 +36,7 @@ const IndexPage = () => { {/* This component will never be loaded */} - {React.noSuchField && } + {falsyField && } {/* Load on demand */} {showMore && } diff --git a/examples/with-iron-session/pages/index.js b/examples/with-iron-session/pages/index.js index 8f0a02e0dd6ac..862210b24cbc3 100644 --- a/examples/with-iron-session/pages/index.js +++ b/examples/with-iron-session/pages/index.js @@ -1,4 +1,3 @@ -import React from 'react' import Layout from '../components/Layout' const Home = () => ( diff --git a/examples/with-iron-session/pages/login.js b/examples/with-iron-session/pages/login.js index 23dbdb5e9fc3b..5a7b1b6e36941 100644 --- a/examples/with-iron-session/pages/login.js +++ b/examples/with-iron-session/pages/login.js @@ -1,4 +1,3 @@ -import React from 'react' import { useState } from 'react' import useUser from '../lib/useUser' import Layout from '../components/Layout' diff --git a/examples/with-iron-session/pages/profile-sg.js b/examples/with-iron-session/pages/profile-sg.js index 2a87f0d7b64bc..d26ef74e917f6 100644 --- a/examples/with-iron-session/pages/profile-sg.js +++ b/examples/with-iron-session/pages/profile-sg.js @@ -1,4 +1,3 @@ -import React from 'react' import useUser from '../lib/useUser' import Layout from '../components/Layout' diff --git a/examples/with-iron-session/pages/profile-ssr.js b/examples/with-iron-session/pages/profile-ssr.js index d0e20c09a758f..e728d1d559d50 100644 --- a/examples/with-iron-session/pages/profile-ssr.js +++ b/examples/with-iron-session/pages/profile-ssr.js @@ -1,4 +1,3 @@ -import React from 'react' import Layout from '../components/Layout' import withSession from '../lib/session' import PropTypes from 'prop-types' diff --git a/examples/with-monaco-editor/pages/index.js b/examples/with-monaco-editor/pages/index.js index 1dd3f867e216b..e2642e35347bc 100644 --- a/examples/with-monaco-editor/pages/index.js +++ b/examples/with-monaco-editor/pages/index.js @@ -1,4 +1,3 @@ -import React from 'react' import dynamic from 'next/dynamic' import sample from '../code-sample' diff --git a/examples/with-next-page-transitions/pages/_app.js b/examples/with-next-page-transitions/pages/_app.js index f22a157f98146..9c9459f5e252b 100644 --- a/examples/with-next-page-transitions/pages/_app.js +++ b/examples/with-next-page-transitions/pages/_app.js @@ -1,4 +1,3 @@ -import React from 'react' import { PageTransition } from 'next-page-transitions' import Loader from '../components/Loader' diff --git a/examples/with-next-page-transitions/pages/_document.js b/examples/with-next-page-transitions/pages/_document.js index e6afe8b3bdcf5..b9d28a347e6fe 100644 --- a/examples/with-next-page-transitions/pages/_document.js +++ b/examples/with-next-page-transitions/pages/_document.js @@ -1,4 +1,3 @@ -import React from 'react' import Document, { Head, Main, NextScript } from 'next/document' export default class MyDocument extends Document { diff --git a/examples/with-next-page-transitions/pages/index.js b/examples/with-next-page-transitions/pages/index.js index 9421cc9ed90e6..e6b2a7aabf3fa 100644 --- a/examples/with-next-page-transitions/pages/index.js +++ b/examples/with-next-page-transitions/pages/index.js @@ -1,4 +1,3 @@ -import React from 'react' import Link from 'next/link' const Index = () => ( diff --git a/examples/with-react-with-styles/pages/_app.js b/examples/with-react-with-styles/pages/_app.js index 7db1439748b04..b342c79114032 100644 --- a/examples/with-react-with-styles/pages/_app.js +++ b/examples/with-react-with-styles/pages/_app.js @@ -1,4 +1,3 @@ -import React from 'react' import { DIRECTIONS } from 'react-with-direction' import AphroditeInterface from 'react-with-styles-interface-aphrodite' import WithStylesContext from 'react-with-styles/lib/WithStylesContext' diff --git a/examples/with-react-with-styles/pages/index.js b/examples/with-react-with-styles/pages/index.js index 19c7c35976b51..8547f8408f7e6 100644 --- a/examples/with-react-with-styles/pages/index.js +++ b/examples/with-react-with-styles/pages/index.js @@ -1,4 +1,3 @@ -import React from 'react' import { css, withStyles } from 'react-with-styles' function Home({ styles }) { diff --git a/examples/with-style-sheet/pages/index.js b/examples/with-style-sheet/pages/index.js index 07b0e2288c994..a8f529f0bff1a 100644 --- a/examples/with-style-sheet/pages/index.js +++ b/examples/with-style-sheet/pages/index.js @@ -1,10 +1,10 @@ -import React from 'react' +import { useState, useEffect } from 'react' import { StyleSheet, StyleResolver } from 'style-sheet' const cls = StyleResolver.resolve export default function Home() { - const [color, setColor] = React.useState('#111') - React.useEffect(() => { + const [color, setColor] = useState('#111') + useEffect(() => { setTimeout(() => { setColor('#00f') }, 2000)