Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 마이페이지 구현 #36

Merged
merged 9 commits into from
Feb 20, 2024
Prev Previous commit
Next Next commit
Fix: 헤더 왼쪽 버튼 'button' 타입으로 설정하여 뒤로가기 클릭시 form submit 되는 오류 해결
seoyoung-min committed Feb 17, 2024
commit ceb4ec48cf074c8b6b0aec720f147825c66dcb3a
2 changes: 1 addition & 1 deletion src/components/Header/Header.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헤더 변경 확인했습니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

버튼 타입을 주지 않으면 form 이 제출되어버리는군요..!?👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

버튼 type속성의 기본값이 'submit'이라,
form태그 안에 있는 버튼은 다 제출기능도 해버리더라구요!!🥲

Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ interface HeaderProps {
function Header({ title, left, leftClick, right }: HeaderProps) {
return (
<div className={styles.header}>
<button onClick={leftClick}>
<button type="button" onClick={leftClick}>
{left === 'close' && <CloseButton width={'24'} height={'24'} alt="닫기버튼" />}
{left === 'back' && <BackIcon alt="뒤로가기 버튼" />}
{left === null && <></>}