Skip to content

Commit a68508e

Browse files
committed
refactor: update component exports to use FunctionComponent type and simplify return types
1 parent 08007dc commit a68508e

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/loader/circles-with-bar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties } from 'react'
1+
import { FunctionComponent } from 'react'
22
import { DEFAULT_COLOR, DEFAULT_WAI_ARIA_ATTRIBUTE, Style } from '../type'
33
import { SvgWrapper } from '../shared/svg-wrapper'
44
import { SVG_NAMESPACE } from '../shared/constants'
@@ -49,7 +49,7 @@ interface CirclesWithBarProps {
4949
* and a wave bars. outer circle, inner circle and bar
5050
* color can be set from props.
5151
*/
52-
export const CirclesWithBar: React.FunctionComponent<CirclesWithBarProps> = ({
52+
export const CirclesWithBar: FunctionComponent<CirclesWithBarProps> = ({
5353
wrapperStyle = {},
5454
visible = true,
5555
wrapperClass = '',
@@ -60,7 +60,7 @@ export const CirclesWithBar: React.FunctionComponent<CirclesWithBarProps> = ({
6060
innerCircleColor,
6161
barColor,
6262
ariaLabel = 'circles-with-bar-loading',
63-
}): React.ReactElement => {
63+
}) => {
6464
return (
6565
<SvgWrapper
6666
style={wrapperStyle}

src/loader/falling-lines.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const FallingLines: FunctionComponent<FallingLinesProps> = ({
4040
color = DEFAULT_COLOR,
4141
width = '100',
4242
visible = true,
43-
}): React.ReactElement | null => {
43+
}) => {
4444
return visible ? (
4545
<svg
4646
xmlns={SVG_NAMESPACE}

src/loader/infinity-spin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const Path = styled.path`
6363
export const InfinitySpin: FunctionComponent<InfinitySpinProps> = ({
6464
color = DEFAULT_COLOR,
6565
width = '200',
66-
}): React.ReactElement => {
66+
}) => {
6767
return (
6868
<svg
6969
xmlns={SVG_NAMESPACE}

src/loader/line-wave.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties } from 'react'
1+
import { FunctionComponent, CSSProperties } from 'react'
22
import { DEFAULT_COLOR, DEFAULT_WAI_ARIA_ATTRIBUTE } from '../type'
33
import { SvgWrapper } from '../shared/svg-wrapper'
44
import { SVG_NAMESPACE } from '../shared/constants'
@@ -46,7 +46,7 @@ interface LineWaveProps {
4646
* @description contains three lines in a wave motion
4747
* line colors are changeable
4848
*/
49-
export const LineWave: React.FunctionComponent<LineWaveProps> = ({
49+
export const LineWave: FunctionComponent<LineWaveProps> = ({
5050
wrapperStyle = {},
5151
visible = true,
5252
wrapperClass = '',
@@ -57,7 +57,7 @@ export const LineWave: React.FunctionComponent<LineWaveProps> = ({
5757
firstLineColor,
5858
middleLineColor,
5959
lastLineColor,
60-
}): React.ReactElement => {
60+
}) => {
6161
return (
6262
<SvgWrapper
6363
style={wrapperStyle}

src/loader/rotating-lines.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const RotatingLines: FunctionComponent<RotatingLinesProps> = ({
106106
ariaLabel = 'rotating-lines-loading',
107107
wrapperStyle,
108108
wrapperClass,
109-
}): React.ReactElement | null => {
109+
}) => {
110110
const lines = useCallback(
111111
() =>
112112
POINTS.map(point => (

src/loader/rotating-square.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties } from 'react'
1+
import { FunctionComponent } from 'react'
22
import { DEFAULT_COLOR, DEFAULT_WAI_ARIA_ATTRIBUTE, Style } from '../type'
33
import { SvgWrapper } from '../shared/svg-wrapper'
44
import { SVG_NAMESPACE } from '../shared/constants'
@@ -38,7 +38,7 @@ interface RotatingSquareProps {
3838
gradientAngle?: number
3939
}
4040

41-
export const RotatingSquare: React.FunctionComponent<RotatingSquareProps> = ({
41+
export const RotatingSquare: FunctionComponent<RotatingSquareProps> = ({
4242
wrapperClass = '',
4343
color = DEFAULT_COLOR,
4444
height = 100,
@@ -47,7 +47,7 @@ export const RotatingSquare: React.FunctionComponent<RotatingSquareProps> = ({
4747
ariaLabel = 'rotating-square-loading',
4848
wrapperStyle = {},
4949
visible = true,
50-
}): React.ReactElement => {
50+
}) => {
5151
return (
5252
<SvgWrapper
5353
style={wrapperStyle}

src/loader/three-circles.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties } from 'react'
1+
import { FunctionComponent, CSSProperties } from 'react'
22
import { DEFAULT_COLOR, DEFAULT_WAI_ARIA_ATTRIBUTE } from '../type'
33
import { SvgWrapper } from '../shared/svg-wrapper'
44
import { SVG_NAMESPACE } from '../shared/constants'
@@ -37,7 +37,7 @@ interface ThreeCirclesProps {
3737
* @description contains three circles rotating in opposite direction
3838
* outer circle, middle circle and inner circle color can be set from props.
3939
*/
40-
export const ThreeCircles: React.FunctionComponent<ThreeCirclesProps> = ({
40+
export const ThreeCircles: FunctionComponent<ThreeCirclesProps> = ({
4141
wrapperStyle = {},
4242
visible = true,
4343
wrapperClass = '',
@@ -48,7 +48,7 @@ export const ThreeCircles: React.FunctionComponent<ThreeCirclesProps> = ({
4848
outerCircleColor,
4949
innerCircleColor,
5050
middleCircleColor,
51-
}): React.ReactElement => {
51+
}) => {
5252
return (
5353
<SvgWrapper
5454
style={wrapperStyle}

src/loader/triangle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const Triangle: FunctionComponent<TriangleProps> = ({
6363
wrapperStyle,
6464
wrapperClass,
6565
visible = true,
66-
}: TriangleProps): React.ReactElement => {
66+
}: TriangleProps) => {
6767
return (
6868
<SvgWrapper
6969
style={wrapperStyle}

0 commit comments

Comments
 (0)