-
Notifications
You must be signed in to change notification settings - Fork 31
[김희성] sprint8 #176
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
[김희성] sprint8 #176
The head ref may contain hidden characters: "React-\uAE40\uD76C\uC131"
Conversation
dongqui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
희성님, 근래 정말 열심히 달리시는군요! 🏃 👍
아직 타입스크립트 활용은 많이 없는 거 같습니다. 아마 기존의 코드를 옮기느냐고 시간을 많이 소비하셨을 거 같아요! 타입스크립트 환경은 만들어 졌으니 스프린트 진행중 차근차근 적용해 보시면 될 거 같습니다!
| validateEmail(email) === "" && validatePassword(password) === ""; | ||
|
|
||
| const handleLogin = async (e) => { | ||
| const handleLogin = async (e: React.FormEvent<HTMLFormElement>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타입을 잘 찾아서 써주셨네요! 👍
| validateAll(); | ||
| }, [validateAll]); | ||
|
|
||
| const handleBlur = (type: "email" | "nickname" | "password" | "confirm") => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controlled/uncontrolled 컴포넌트 개념을 알아두시면 좋습니다!
지금 같은 경우 세부적으로 핸들링해야할 때는 controlled로 구현하시는 것이 좋을 수 있습니다.
아니면 react-hook-form 같은 라이브러리를 사용하시는 것도 좋아요 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타입스크립트를 쓰시니 zod도 궁합이 좋습니다!!
| const password = passwordRef.current?.value.trim() ?? ""; | ||
| const passwordConfirm = passwordConfirmRef.current?.value.trim() ?? ""; | ||
|
|
||
| const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중복되는 코드, 로직이 많습니다 😢 아마 리엑트로 옮기느냐고 정신이 없으셨을 거 같아요!
ref로 직접 접근하기 때문에 이벤트마다 따로 처리하느냐고 중복되는 느낌도 있는 거 같습니다.
여유가 되실 때 천천히 리팩토링 해보셔도 좋을 거 같아요 :)
요구사항
기본
심화
주요 변경사항
스크린샷
랜딩페이지
로그인
회원가입
멘토에게