types: children ReactNode

This commit is contained in:
Junseo Park 2021-02-27 13:47:06 +09:00
parent eaf0842672
commit cf36193c8e
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import Link from 'next/link'
import { ReactNode } from 'react'
const Button = ({ type='button', className, children, href, onClick }: ButtonProps):JSX.Element => {
return href ? <Link href={href}>
@ -15,7 +16,7 @@ const Button = ({ type='button', className, children, href, onClick }: ButtonPro
interface ButtonProps {
type?: 'button' | 'submit' | 'reset'
className?: string
children: JSX.Element | string
children: ReactNode
href?: string
onClick?: () => void
}

View File

@ -1,3 +1,5 @@
import { ReactNode } from 'react'
const Container = ({
ignoreColor,
className,
@ -19,7 +21,7 @@ interface ContainerProps {
ignoreColor?: boolean
className?: string
paddingTop?: boolean
children: JSX.Element | JSX.Element[]
children: ReactNode
}
export default Container