From cf36193c8e43dbc8a8b49f8bb7837988a080ce0d Mon Sep 17 00:00:00 2001 From: Junseo Park Date: Sat, 27 Feb 2021 13:47:06 +0900 Subject: [PATCH] types: children ReactNode --- components/Button.tsx | 3 ++- components/Container.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/Button.tsx b/components/Button.tsx index 1eb31f8..6154390 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -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 ? @@ -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 } diff --git a/components/Container.tsx b/components/Container.tsx index c7ad5a8..2389a82 100644 --- a/components/Container.tsx +++ b/components/Container.tsx @@ -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