Skip to content

Commit

Permalink
fix: useId 사용해서 고유 id 가지도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SeieunYoo committed Jun 7, 2024
1 parent 9e0a30c commit ed65dff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/wow-ui/src/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
InputHTMLAttributes,
PropsWithChildren,
} from "react";
import { forwardRef } from "react";
import { forwardRef, useId } from "react";
import { Check as CheckIcon } from "wowds-icons";

//FIXME: alias 경로로 설정하면 import 경로 인식하지 못하는 문제가 있어서 상대경로로 우선 해결
Expand Down Expand Up @@ -62,7 +62,8 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
},
ref
) => {
const id = inputProps?.id ?? "checkbox";
const defaultId = `checkbox-${useId()}`;
const id = inputProps?.id ?? defaultId;

const {
checked,
Expand Down

0 comments on commit ed65dff

Please sign in to comment.