Skip to content

Commit

Permalink
[docs] Use import * as React from 'react';
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrookes committed Aug 3, 2020
1 parent 29cae11 commit f5bad2b
Show file tree
Hide file tree
Showing 1,182 changed files with 1,419 additions and 1,345 deletions.
2 changes: 1 addition & 1 deletion docs/src/modules/components/Ad.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AdCarbon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import loadScript from 'docs/src/modules/utils/loadScript';
import AdDisplay from 'docs/src/modules/components/AdDisplay';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AdDisplay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint react/jsx-no-target-blank: ["error", { allowReferrer: true }] */
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AdInHouse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint react/jsx-no-target-blank: ["error", { allowReferrer: true }] */
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import AdDisplay from 'docs/src/modules/components/AdDisplay';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AdReadthedocs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import loadScript from 'docs/src/modules/utils/loadScript';
import adStyles from 'docs/src/modules/components/ad.styles';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppContainer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppDrawer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppDrawerNavItem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppFooter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable material-ui/no-hardcoded-labels */
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import Interpolate from '@trendmicro/react-interpolate';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppFrame.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import Router, { useRouter } from 'next/router';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppSearch.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import url from 'url';
import { useSelector } from 'react-redux';
import useLazyCSS from 'docs/src/modules/utils/useLazyCSS';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppTableOfContents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable react/no-danger */
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import throttle from 'lodash/throttle';
import clsx from 'clsx';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppTheme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import Head from 'docs/src/modules/components/Head';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/Demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import LZString from 'lz-string';
import PropTypes from 'prop-types';
import clsx from 'clsx';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/DemoErrorBoundary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import Typography from '@material-ui/core/Typography';
import Link from '@material-ui/core/Link';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/DemoSandboxed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import { create } from 'jss';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/DiamondSponsors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import Typography from '@material-ui/core/Typography';
import { useSelector } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/EditPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import Button from '@material-ui/core/Button';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/GoogleAnalytics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';

// So we can write code like:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/Head.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import NextHead from 'next/head';
import { useRouter } from 'next/router';
import PropTypes from 'prop-types';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/Link.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable jsx-a11y/anchor-has-content */
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { useRouter } from 'next/router';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/MarkdownDocs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import { useSelector } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/MarkdownElement.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/MarkdownLinks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import Router from 'next/router';
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/Notifications.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable react/no-danger, react-hooks/exhaustive-deps */
import React from 'react';
import * as React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { makeStyles } from '@material-ui/core/styles';
import NotificationsIcon from '@material-ui/icons/Notifications';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/PageContext.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

// The default value is never and should never be used.
// It's here to improve DX by enabling autocompletion for editors supporting TypeScript.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ThemeContext.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import {
ThemeProvider as MuiThemeProvider,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/TopLayoutBlog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Head from 'docs/src/modules/components/Head';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/TopLayoutCompany.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Head from 'docs/src/modules/components/Head';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/utils/getDemoConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function jsDemo(demoData) {
files: {
'demo.js': demoData.raw,
'index.js': `
import React from 'react';
import * as React from 'react';
import ReactDOM from 'react-dom';
import Demo from './demo';
Expand All @@ -23,7 +23,7 @@ function tsDemo(demoData) {
files: {
'demo.tsx': demoData.raw,
'index.tsx': `
import React from 'react';
import * as React from 'react';
import ReactDOM from 'react-dom';
import Demo from './demo';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/utils/getJsxPreview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('getJsxPreview', () => {
expect(
getJsxPreview(
`
import React from 'react';
import * as React from 'react';
import Rating from '@material-ui/lab/Rating';
export default function HalfRating() {
Expand Down
8 changes: 4 additions & 4 deletions docs/src/modules/utils/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getDependencies } from './helpers';

describe('docs getDependencies helpers', () => {
const s1 = `
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Input from '@material-ui/core/Input';
Expand Down Expand Up @@ -32,7 +32,7 @@ const styles = theme => ({

it('should handle * dependencies', () => {
const source = `
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import * as _ from '@unexisting/thing';
import Draggable from 'react-draggable';
Expand Down Expand Up @@ -68,7 +68,7 @@ const suggestions = [

it('should support direct import', () => {
const source = `
import React from 'react';
import * as React from 'react';
import PropTypes from 'prop-types';
import Grid from '@material-ui/core/Grid';
import { withStyles } from '@material-ui/core/styles';
Expand Down Expand Up @@ -103,7 +103,7 @@ import { LocalizationProvider as MuiPickersLocalizationProvider, KeyboardTimePic

it('should handle multilines', () => {
const source = `
import React from 'react';
import * as React from 'react';
import DateFnsAdapter from '@material-ui/pickers/adapter/date-fns';
import {
LocalizationProvider as MuiPickersLocalizationProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionSummary from '@material-ui/core/AccordionSummary';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionSummary from '@material-ui/core/AccordionSummary';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionDetails from '@material-ui/core/AccordionDetails';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionDetails from '@material-ui/core/AccordionDetails';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { withStyles } from '@material-ui/core/styles';
import MuiAccordion from '@material-ui/core/Accordion';
import MuiAccordionSummary from '@material-ui/core/AccordionSummary';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { withStyles } from '@material-ui/core/styles';
import MuiAccordion from '@material-ui/core/Accordion';
import MuiAccordionSummary from '@material-ui/core/AccordionSummary';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/accordion/DetailedAccordion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import clsx from 'clsx';
import Accordion from '@material-ui/core/Accordion';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/accordion/DetailedAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { Theme, createStyles, makeStyles } from '@material-ui/core/styles';
import clsx from 'clsx';
import Accordion from '@material-ui/core/Accordion';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/accordion/SimpleAccordion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionSummary from '@material-ui/core/AccordionSummary';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/accordion/SimpleAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { Theme, createStyles, makeStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionSummary from '@material-ui/core/AccordionSummary';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/ActionAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';
import Button from '@material-ui/core/Button';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/ActionAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';
import Button from '@material-ui/core/Button';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/ColorAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import Alert from '@material-ui/lab/Alert';

export default function ColorAlerts() {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/ColorAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import Alert from '@material-ui/lab/Alert';

export default function ColorAlerts() {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/DescriptionAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Alert, AlertTitle } from '@material-ui/lab';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/DescriptionAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import { Alert, AlertTitle } from '@material-ui/lab';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/FilledAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/FilledAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/IconAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';
import CheckIcon from '@material-ui/icons/Check';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/IconAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';
import CheckIcon from '@material-ui/icons/Check';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/OutlinedAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/OutlinedAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/SimpleAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/SimpleAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/TransitionAlerts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';
import IconButton from '@material-ui/core/IconButton';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/alert/TransitionAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import Alert from '@material-ui/lab/Alert';
import IconButton from '@material-ui/core/IconButton';
Expand Down
Loading

0 comments on commit f5bad2b

Please sign in to comment.