Skip to content

Commit

Permalink
fix: 체크박스 id 설정 부분 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Doeunnkimm committed Aug 24, 2024
1 parent 6de92dd commit fe862d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/sds/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {

export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
const {
id: idFromProps,
label,
checked: checkedFromProps,
defaultChecked,
Expand All @@ -26,7 +27,7 @@ export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref)
...restProps
} = props;

const id = useId();
const id = idFromProps ?? useId();

const [checked = false, setChecked] = useControllableState({
prop: checkedFromProps,
Expand Down

0 comments on commit fe862d3

Please sign in to comment.