From a2f01444d90191275b3d0530251978f97f5c1753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20C=C3=A9lio?= Date: Tue, 18 Aug 2020 20:06:33 -0300 Subject: [PATCH] fix: react import location and functions --- src/Color/Color.component.test.tsx | 2 +- src/Color/Color.component.tsx | 2 +- src/Color/useColor.ts | 4 ++-- src/Palette/Palette.component.test.tsx | 2 +- src/Palette/Palette.component.tsx | 2 +- src/Palette/usePalette.ts | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Color/Color.component.test.tsx b/src/Color/Color.component.test.tsx index fb2e982..0eb1c27 100644 --- a/src/Color/Color.component.test.tsx +++ b/src/Color/Color.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render, act, waitFor } from '@testing-library/react'; import Color from './Color.component'; diff --git a/src/Color/Color.component.tsx b/src/Color/Color.component.tsx index 9a65495..3988f47 100644 --- a/src/Color/Color.component.tsx +++ b/src/Color/Color.component.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ColorFormats, ReducerState, ArrayRGB } from '../types'; import useColor from './useColor'; diff --git a/src/Color/useColor.ts b/src/Color/useColor.ts index 40b527a..21bcd10 100644 --- a/src/Color/useColor.ts +++ b/src/Color/useColor.ts @@ -1,5 +1,5 @@ +import * as React from 'react'; import { useCurrentEffect } from 'use-current-effect'; -import { useReducer } from 'react'; import { getPredominantColorFromImgURL, reducer, @@ -20,7 +20,7 @@ export default function useColor< ): S { const { crossOrigin = null, quality = 10 } = options; - const [state, dispatch] = useReducer(reducer, initialReducerState); + const [state, dispatch] = React.useReducer(reducer, initialReducerState); useCurrentEffect( (isCurrent) => { diff --git a/src/Palette/Palette.component.test.tsx b/src/Palette/Palette.component.test.tsx index 96b57cb..a7a4e27 100644 --- a/src/Palette/Palette.component.test.tsx +++ b/src/Palette/Palette.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { render, waitFor, act } from '@testing-library/react'; import Palette from './Palette.component'; diff --git a/src/Palette/Palette.component.tsx b/src/Palette/Palette.component.tsx index 38a381e..8933f85 100644 --- a/src/Palette/Palette.component.tsx +++ b/src/Palette/Palette.component.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { ColorFormats, ReducerState, ArrayRGB } from '../types'; import usePalette from './usePalette'; diff --git a/src/Palette/usePalette.ts b/src/Palette/usePalette.ts index ce666ee..1cbb065 100644 --- a/src/Palette/usePalette.ts +++ b/src/Palette/usePalette.ts @@ -1,5 +1,5 @@ +import * as React from 'react'; import { useCurrentEffect } from 'use-current-effect'; -import { useReducer } from 'react'; import { getColorsPaletteFromImgUrl, reducer, @@ -21,7 +21,7 @@ export default function usePalette< ): S { const { crossOrigin = null, quality = 10 } = options; - const [state, dispatch] = useReducer(reducer, initialReducerState); + const [state, dispatch] = React.useReducer(reducer, initialReducerState); useCurrentEffect( (isCurrent) => {