-
Notifications
You must be signed in to change notification settings - Fork 1
[Week4/mission] 첫 커스텀 훅 만들어보기, 로그인 / 회원가입 기능 구현해보기 (feat. 유효성 검사) #26
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
Conversation
duwlsssss
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.
고생하셨어요!!
| <NavLink | ||
| to={to} | ||
| className={({ isActive }) => | ||
| clsx( | ||
| 'text-base transition hover:text-indigo-600', | ||
| isActive && 'text-indigo-700 font-bold', | ||
| ) | ||
| } | ||
| > | ||
| {children} | ||
| </NavLink> |
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.
tailwind랑 NavLink랑 같이 쓰기 너무 좋아보이네요!
| value: string; | ||
| onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
| onBlur: () => void; | ||
| ref: React.Ref<HTMLInputElement>; |
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의 역할은 뭔가여??
S-Gihun
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.
고생 많으셨습니다 !
|
|
||
| const { email, password, passwordCheck, name } = watch(); | ||
|
|
||
| const isStep1Valid = email && !errors.email; |
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.
const handleNext = async (fieldsToValidate: (keyof FormFields)[]) => {
const valid = await methods.trigger(fieldsToValidate);
if (valid) {
setStep((prev) => prev + 1);
}
};이 코드 참고해보시면 좋을 거 같습니다.
✏️ 작업 내용
#️⃣ 연관된 이슈
#20
📷 작업 결과
week4-mission1.mp4
week4-mission2.mp4
week4-mission3.mp4
💡 함께 공유하고 싶은 부분
Signup 페이지에서 input을 컴포넌트화하려 했는데 react-hook-form에서 커스텀 컴포넌트를 사용하려면 register가 아닌 controller를 사용해야 한다고 해서 써봤습니다. 간단한 사용법만 있는 페이지 공유드릴게요 :)
https://toby2009.tistory.com/56
그리고 Nav에서 Link를 컴포넌트로 빼다가 NavLink라는 것을 알았습니다. react-router-dom에서 지원해주는건데 isActive를 활용하면 params나 location 없이도 링크를 추적해서 boolean을 뱉어준다고 하네요
https://velog.io/@exceed96/React-Link-NavLink
🤔 질문
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트