Skip to content

Commit

Permalink
refactor: declare event handler for checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
greenblues1190 committed Oct 10, 2022
1 parent f778095 commit e9019cc
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const ApplicationPreviewModal = ({
const { closeModal } = useModalContext();
const [isChecked, setIsChecked] = useState(false);

const handleChangeConfirmCheckbox: React.FormEventHandler<HTMLInputElement> = (e) => {
setIsChecked((e.target as HTMLInputElement).checked);
};

const handleClickDismissButton: React.MouseEventHandler<HTMLButtonElement> = () => {
closeModal();
};
Expand Down Expand Up @@ -69,9 +73,7 @@ const ApplicationPreviewModal = ({
name="confirm-submit"
label="제출한 뒤에는 수정할 수 없음을 확인했습니다."
checked={isChecked}
onChange={(e: ChangeEvent) => {
setIsChecked((e.target as HTMLInputElement).checked);
}}
onChange={handleChangeConfirmCheckbox}
autoFocus
required
/>
Expand Down

0 comments on commit e9019cc

Please sign in to comment.