From a9ae51ef2bc1b533ab6a01d502d58496f0e17821 Mon Sep 17 00:00:00 2001 From: semnil5202 Date: Sat, 16 Mar 2024 01:11:41 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20Badge=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20children=EC=9D=84=20ReactNode=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=ED=99=95=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Badge/Badge.tsx | 4 ++-- src/stories/Badge.stories.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Badge/Badge.tsx b/src/components/Badge/Badge.tsx index 861a1da..d63c65c 100644 --- a/src/components/Badge/Badge.tsx +++ b/src/components/Badge/Badge.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import { ComponentPropsWithoutRef, ElementType } from 'react'; +import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react'; import { ColorType } from '../../styles/theme'; @@ -10,7 +10,7 @@ type Props = { as?: T; backgroundColor?: BackgroundColorType; fontColor?: FontColorType; - children: number | string; + children: ReactNode; } & ComponentPropsWithoutRef; const Badge = ({ diff --git a/src/stories/Badge.stories.tsx b/src/stories/Badge.stories.tsx index 940b2d2..bceafd1 100644 --- a/src/stories/Badge.stories.tsx +++ b/src/stories/Badge.stories.tsx @@ -1,7 +1,7 @@ import { Meta, StoryObj } from '@storybook/react'; import Badge from '../components/Badge/Badge'; -import { useEffect, useRef, useState } from 'react'; +import { ReactNode, useEffect, useRef, useState } from 'react'; const meta = { title: 'Components/Badge', @@ -55,7 +55,7 @@ export const Sample: Story = { }, render: ({ children, backgroundColor, fontColor }) => { const timerId = useRef(null); - const [badges, setBadges] = useState([ + const [badges, setBadges] = useState([ '서비스기획', '영상디자인', '시각디자인',