Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
chore: use React.FC instead of FC
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-ge committed Apr 30, 2022
1 parent e16e462 commit a671e51
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions examples/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { FC, useState } from 'react'
import React, { useState } from 'react'
import { chessOptions } from './data/options'
import ColumnSelect from '../src'

const Basic: FC = () => {
const Basic: React.FC = () => {
const [selected, setSelected] = useState([])

return (
<div>
<p>Choose your favorite chess pieces.</p>
Expand Down
4 changes: 2 additions & 2 deletions examples/ReactHookForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import React from 'react'
import { useForm, Controller } from 'react-hook-form'
import ColumnSelect from '../src'
import type { OptionType } from '../src/types'
Expand All @@ -9,7 +9,7 @@ type FormData = {
favorites: string[]
}

const ReactHookForm: FC = () => {
const ReactHookForm: React.FC = () => {
const { register, control, setValue, handleSubmit } = useForm()

const onSubmit = (data: FormData) => {
Expand Down
4 changes: 2 additions & 2 deletions src/ColumnSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useEffect, useMemo, useState } from 'react'
import React, { useEffect, useMemo, useState } from 'react'
import Container from './components/container/container'
import type {
OptionType,
Expand Down Expand Up @@ -67,7 +67,7 @@ interface ColumnSelectProps {
theme?: Theme
}

const ColumnSelect: FC<ColumnSelectProps> = ({
const ColumnSelect: React.FC<ColumnSelectProps> = ({
options,
onChange,
defaultValue = [],
Expand Down
4 changes: 2 additions & 2 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, ReactElement } from 'react'
import React, { ReactElement } from 'react'
import type { Theme } from '../../types'
import { Button as StyledButton, ButtonIcon } from './button.styles'

Expand Down Expand Up @@ -41,7 +41,7 @@ interface ButtonProps {
theme: Theme
}

const Button: FC<ButtonProps> = ({
const Button: React.FC<ButtonProps> = ({
leftIcon,
rightIcon,
label,
Expand Down
4 changes: 2 additions & 2 deletions src/components/container/container.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useState, KeyboardEvent, ChangeEvent, useMemo } from 'react'
import React, { useState, KeyboardEvent, ChangeEvent, useMemo } from 'react'
import {
Grid,
GridItemHeaderLeft,
Expand Down Expand Up @@ -99,7 +99,7 @@ interface ContainerProps {
theme: Theme
}

const Container: FC<ContainerProps> = ({
const Container: React.FC<ContainerProps> = ({
leftHeader,
rightHeader,
current,
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/AddAll.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { FC } from 'react'
import React from 'react'

/**
* Icons by Heroicons
* https://github.com/tailwindlabs/heroicons
*/

const AddAll: FC = () => (
const AddAll: React.FC = () => (
<svg
stroke='currentColor'
fill='currentColor'
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/AddIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { FC } from 'react'
import React from 'react'

/**
* Icons by Heroicons
* https://github.com/tailwindlabs/heroicons
*/

const AddIcon: FC = () => (
const AddIcon: React.FC = () => (
<svg
stroke='currentColor'
fill='currentColor'
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/RemoveAll.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { FC } from 'react'
import React from 'react'

/**
* Icons by Heroicons
* https://github.com/tailwindlabs/heroicons
*/

const RemoveAll: FC = () => (
const RemoveAll: React.FC = () => (
<svg
stroke='currentColor'
fill='currentColor'
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/RemoveIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { FC } from 'react'
import React from 'react'

/**
* Icons by Heroicons
* https://github.com/tailwindlabs/heroicons
*/

const RemoveIcon: FC = () => (
const RemoveIcon: React.FC = () => (
<svg
stroke='currentColor'
fill='currentColor'
Expand Down
4 changes: 2 additions & 2 deletions src/components/option/option.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import React from 'react'
import type { OptionType, Theme } from '../../types'
import { OptionButton } from './option.style'

Expand Down Expand Up @@ -26,7 +26,7 @@ interface OptionProps {
theme: Theme
}

const Option: FC<OptionProps> = ({
const Option: React.FC<OptionProps> = ({
label,
isSelected,
onClick,
Expand Down
2 changes: 1 addition & 1 deletion stories/ColumnSelect.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Story, Meta } from '@storybook/react'
import type { Story, Meta } from '@storybook/react'

import ColumnSelect, { options } from './ColumnSelect'

Expand Down
4 changes: 2 additions & 2 deletions stories/ColumnSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useState } from 'react'
import React, { useState } from 'react'
import ColumnSelect from '../src'
import type { OptionsType, Theme } from '../src/types'
import './column_select.css'
Expand All @@ -22,7 +22,7 @@ export const options = [
{ value: 'king', label: 'King' },
]

const ColumnSelectExample: FC<ColumnSelectProps> = ({
const ColumnSelectExample: React.FC<ColumnSelectProps> = ({
theme,
defaultValue,
max,
Expand Down

0 comments on commit a671e51

Please sign in to comment.