use FC instead of FunctionalComponent

This commit is contained in:
Luis Alvarez
2020-10-01 21:30:52 -05:00
parent cf7c85e3ba
commit 44a41eb3e1
17 changed files with 34 additions and 52 deletions

View File

@@ -1,13 +1,13 @@
import cn from 'classnames'
import s from './ProductCard.module.css'
import React, { FunctionComponent } from 'react'
import React, { FC } from 'react'
import { Heart } from '@components/icon'
interface Props {
className?: string
children?: any
}
const ProductCard: FunctionComponent<Props> = ({ className }) => {
const ProductCard: FC<Props> = ({ className }) => {
const rootClassName = cn(s.root, className)
return (
<div className={rootClassName}>

View File

@@ -1,5 +1,5 @@
import cn from 'classnames'
import React, { FunctionComponent } from 'react'
import React, { FC } from 'react'
import s from './ProductGrid.module.css'
import ProductCard from '@components/ProductCard'
interface Props {
@@ -8,7 +8,7 @@ interface Props {
products: [any]
}
const ProductView: FunctionComponent<Props> = ({ products, className }) => {
const ProductView: FC<Props> = ({ products, className }) => {
const rootClassName = cn(s.root, className)
return (
<div className={rootClassName}>

View File

@@ -1,5 +1,5 @@
import cn from 'classnames'
import React, { FunctionComponent } from 'react'
import React, { FC } from 'react'
import s from './ProductView.module.css'
import { Button } from '@components/ui'
import { Swatch } from '@components/product'
@@ -10,7 +10,7 @@ interface Props {
productData: ProductData
}
const ProductView: FunctionComponent<Props> = ({ productData, className }) => {
const ProductView: FC<Props> = ({ productData, className }) => {
const rootClassName = cn(s.root, className)
console.log(productData)
return (

View File

@@ -1,5 +1,5 @@
import cn from 'classnames'
import React, { FunctionComponent } from 'react'
import React, { FC } from 'react'
import s from './Swatch.module.css'
import { Colors } from '@components/ui/types'
@@ -11,12 +11,7 @@ interface Props {
size?: string
}
const Swatch: FunctionComponent<Props> = ({
className,
size,
color,
active,
}) => {
const Swatch: FC<Props> = ({ className, size, color, active }) => {
const rootClassName = cn(
s.root,
{