Skip to content

Commit

Permalink
chore: 토글 컴포넌트 props 타입 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ghdtjgus76 committed May 24, 2024
1 parent 15cb024 commit d399542
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/wow-ui/src/components/Toggle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type {
import { forwardRef, useEffect, useState } from "react";

import type {
AsProps,
PolymorphicComponentProps,
PolymorphicRef,
} from "@/types/Polymorphic";
Expand All @@ -30,7 +29,7 @@ import type {
* @param {ComponentPropsWithoutRef<T>} rest 렌더링된 요소 또는 컴포넌트에 전달할 추가 props.
* @param {ComponentPropsWithRef<T>["ref"]} ref 렌더링된 요소 또는 컴포넌트에 연결할 ref.
*/
export interface ToggleProps<T extends ElementType> extends AsProps<T> {
export interface ToggleProps {
defaultChecked?: boolean;
isDisabled?: boolean;
isChecked?: boolean;
Expand All @@ -57,7 +56,7 @@ const ToggleIcon = ({
};

type ToggleComponent = <T extends ElementType = "button">(
props: ToggleProps<T>
props: PolymorphicComponentProps<T, ToggleProps>
) => ReactNode | null;

const Toggle: ToggleComponent = forwardRef(
Expand All @@ -72,7 +71,7 @@ const Toggle: ToggleComponent = forwardRef(
onKeyDown,
onChange,
...rest
}: PolymorphicComponentProps<T, ToggleProps<T>>,
}: PolymorphicComponentProps<T, ToggleProps>,
ref: PolymorphicRef<T>
) => {
const [isActive, setIsActive] = useState(() =>
Expand Down

0 comments on commit d399542

Please sign in to comment.