diff --git a/src/app/App.tsx b/src/app/App.tsx index 5e39a708..1c6f587b 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,9 +1,9 @@ -import React from 'react'; +import React, { ReactElement } from 'react'; import Routing from '~/components/routing'; import './assets/scss/styles.scss'; -const App = (): React.ReactElement => ; +const App = (): ReactElement => ; export default App; diff --git a/src/app/components/common/ImgLoader/ImgLoader.tsx b/src/app/components/common/ImgLoader/ImgLoader.tsx index 63723f35..18f60ee4 100644 --- a/src/app/components/common/ImgLoader/ImgLoader.tsx +++ b/src/app/components/common/ImgLoader/ImgLoader.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, memo } from 'react'; +import React, { useState, useEffect, memo, ReactElement } from 'react'; import Spinner from '~/components/base/Spinner'; @@ -11,7 +11,7 @@ type PropsType = { onError?: (error: string | Event) => void; }; -function ImgLoader({ src, onError }: PropsType): React.ReactElement { +function ImgLoader({ src, onError }: PropsType): ReactElement { const [imgObj, setImg] = useState({ img: '', isLoading: true }); const image = new Image(); diff --git a/src/app/components/common/LazyComponent/LazyComponent.test.tsx b/src/app/components/common/LazyComponent/LazyComponent.test.tsx index b41c8809..1bf8b9e0 100644 --- a/src/app/components/common/LazyComponent/LazyComponent.test.tsx +++ b/src/app/components/common/LazyComponent/LazyComponent.test.tsx @@ -1,10 +1,10 @@ -import React from 'react'; +import React, { ReactElement } from 'react'; import { act } from 'react-dom/test-utils'; import { render, RenderResult } from '@testing-library/react'; import LazyComponent from './LazyComponent'; -const Example = (): React.ReactElement =>
Some Component
; +const Example = (): ReactElement =>
Some Component
; describe('LazyComponent', () => { // eslint-disable-next-line prettier/prettier @@ -14,7 +14,7 @@ describe('LazyComponent', () => { await act(async () => { testRenderer = render( React.ReactElement }> => + getModule={(): Promise<{ default: () => ReactElement }> => Promise.resolve({ default: Example }) } />, diff --git a/src/app/components/common/LazyComponent/LazyComponent.tsx b/src/app/components/common/LazyComponent/LazyComponent.tsx index e136fb7b..89673126 100644 --- a/src/app/components/common/LazyComponent/LazyComponent.tsx +++ b/src/app/components/common/LazyComponent/LazyComponent.tsx @@ -1,14 +1,14 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect, ReactElement, ElementType } from 'react'; -type GetModule = () => Promise<{ default: () => React.ReactElement }>; +type GetModule = () => Promise<{ default: () => ReactElement }>; type PropsType = { getModule: GetModule; - children?: React.ElementType; + children?: ElementType; }; -const LazyComponent = ({ getModule, ...rest }: PropsType): React.ReactElement | null => { - const [AsyncModule, setAsyncModule] = useState<(() => React.ReactElement) | null>(null); +const LazyComponent = ({ getModule, ...rest }: PropsType): ReactElement | null => { + const [AsyncModule, setAsyncModule] = useState<(() => ReactElement) | null>(null); useEffect(() => { (async (): Promise => { diff --git a/src/app/components/core/Footer/Footer.tsx b/src/app/components/core/Footer/Footer.tsx index e9bb8a98..1782dfc8 100755 --- a/src/app/components/core/Footer/Footer.tsx +++ b/src/app/components/core/Footer/Footer.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { ReactElement } from 'react'; import { useSelector } from 'react-redux'; @@ -9,7 +9,7 @@ import Icon from '~/components/base/Icon'; import './Footer.scss'; -const Footer = (): React.ReactElement => { +const Footer = (): ReactElement => { const { social }: FooterType = useSelector(getFooter); return ( diff --git a/src/app/components/core/Header/Header.tsx b/src/app/components/core/Header/Header.tsx index 2120a78f..8b401f14 100644 --- a/src/app/components/core/Header/Header.tsx +++ b/src/app/components/core/Header/Header.tsx @@ -1,9 +1,9 @@ -import React from 'react'; +import React, { ReactElement } from 'react'; import Navigation from '~/components/core/Navigation'; import UserMenu from '~/components/core/UserMenu'; -const Header = (): React.ReactElement => ( +const Header = (): ReactElement => (
diff --git a/src/app/components/core/Navigation/Navigation.tsx b/src/app/components/core/Navigation/Navigation.tsx index 8a88a756..e041df74 100755 --- a/src/app/components/core/Navigation/Navigation.tsx +++ b/src/app/components/core/Navigation/Navigation.tsx @@ -1,5 +1,5 @@ /* eslint-disable prettier/prettier */ -import React from 'react'; +import React, { ReactElement } from 'react'; import { NavLink } from 'react-router-dom'; type Links = Array<{ @@ -10,7 +10,7 @@ type Links = Array<{ const links: Links = []; -function Navigation(): React.ReactElement { +function Navigation(): ReactElement { return (