Skip to content

Commit

Permalink
Migrate to import * as React from 'react'
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Feb 23, 2020
1 parent 5a90553 commit a13e6e3
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion __fixtures__/template.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = () => (code, state) => `
import React from 'react'
import * as React from 'react'
export default function ${state.componentName}() {
return ${code}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ describe('plugin', () => {
{ template },
opts,
{ jsx },
) => template.ast`import React from 'react';
) => template.ast`import * as React from 'react';
const MyComponent = () => ${jsx}
export default MyComponent
`,
state: { componentName: 'SvgComponent' },
})
expect(code).toMatchInlineSnapshot(`
"import React from 'react';
"import * as React from 'react';
const MyComponent = () => <svg><div /></svg>;
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/CodeFund.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

function useScript(src) {
React.useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/DropArea.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 styled from '@xstyled/styled-components'

const FullWidth = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/Editor.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 { useColorMode } from '@xstyled/styled-components'

import AceEditor from 'react-ace'
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/Loading.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 styled, { keyframes } from 'styled-components'
import { graphql, StaticQuery } from 'gatsby'

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/Playground.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable jsx-a11y/accessible-emoji */
import React from 'react'
import * as React from 'react'
import styled, {
Box,
createGlobalStyle,
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/Query.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 qs from 'query-string'
import { createBrowserHistory } from 'history'

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/Settings.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 styled, { up, css } from '@xstyled/styled-components'
import { Form, FormSpy } from 'react-final-form'
import { SettingsFieldBoolean } from './SettingsFieldBoolean'
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/SettingsFieldBoolean.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 { Box } from '@xstyled/styled-components'
import { FormCheck, FormCheckLabel } from '@smooth-ui/core-sc'
import { CheckboxControl } from './controls/CheckboxControl'
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/SettingsFieldEnum.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 { Box } from '@xstyled/styled-components'
import { FormField, FormCheck, FormCheckLabel } from '@smooth-ui/core-sc'
import { RadioControl } from 'components/playground/controls/RadioControl'
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/SettingsFieldInteger.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 { Box } from '@xstyled/styled-components'
import { FormField } from '@smooth-ui/core-sc'
import { InputControl } from './controls/InputControl'
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/SettingsFieldString.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 { Box } from '@xstyled/styled-components'
import { FormField } from '@smooth-ui/core-sc'
import { TextareaControl } from 'components/playground/controls/TextareaControl'
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/SettingsGroup.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 styled, { up, css, Box } from '@xstyled/styled-components'
import { useHiddenState, Hidden, HiddenDisclosure } from 'reakit/Hidden'
import { ChevronLeft } from 'components/playground/icons/ChevronLeft'
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 { Field } from 'react-final-form'
import { Checkbox } from '@smooth-ui/core-sc'

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/controls/InputControl.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 { Field } from 'react-final-form'
import { Input } from '@smooth-ui/core-sc'

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/controls/RadioControl.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 { Field } from 'react-final-form'
import { Radio } from '@smooth-ui/core-sc'

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 { Field } from 'react-final-form'
import { Textarea } from '@smooth-ui/core-sc'

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/playground/icons/ChevronLeft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

export const ChevronLeft = props => (
<svg
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/jsx-one-expression-per-line */
/* eslint-disable jsx-a11y/accessible-emoji */
import React from 'react'
import * as React from 'react'
import { Box } from '@xstyled/styled-components'
import Helmet from 'react-helmet'
import { HomeHero, ShowCase, BaseLayout } from 'smooth-doc/components'
Expand Down
2 changes: 1 addition & 1 deletion website/src/smooth-doc/components/ThemeProvider.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 { ThemeProvider as SCThemeProvider } from '@xstyled/styled-components'
import deepmerge from 'deepmerge'
import { theme as suiTheme } from '@smooth-ui/core-sc'
Expand Down

0 comments on commit a13e6e3

Please sign in to comment.