[Week4/mission] 첫 커스텀 훅 만들어보기, 로그인 / 회원가입 기능 구현해보기 (feat. 유효성 검사)#26
Merged
leetaesk merged 3 commits intojackson/mainfrom Apr 11, 2025
Merged
[Week4/mission] 첫 커스텀 훅 만들어보기, 로그인 / 회원가입 기능 구현해보기 (feat. 유효성 검사)#26leetaesk merged 3 commits intojackson/mainfrom
leetaesk merged 3 commits intojackson/mainfrom
Conversation
duwlsssss
approved these changes
Apr 11, 2025
Comment on lines
+11
to
+21
| <NavLink | ||
| to={to} | ||
| className={({ isActive }) => | ||
| clsx( | ||
| 'text-base transition hover:text-indigo-600', | ||
| isActive && 'text-indigo-700 font-bold', | ||
| ) | ||
| } | ||
| > | ||
| {children} | ||
| </NavLink> |
Contributor
There was a problem hiding this comment.
tailwind랑 NavLink랑 같이 쓰기 너무 좋아보이네요!
| value: string; | ||
| onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
| onBlur: () => void; | ||
| ref: React.Ref<HTMLInputElement>; |
starvingorange
approved these changes
Apr 11, 2025
JeonSuna
approved these changes
Apr 11, 2025
S-Gihun
approved these changes
Apr 11, 2025
|
|
||
| const { email, password, passwordCheck, name } = watch(); | ||
|
|
||
| const isStep1Valid = email && !errors.email; |
There was a problem hiding this comment.
const handleNext = async (fieldsToValidate: (keyof FormFields)[]) => {
const valid = await methods.trigger(fieldsToValidate);
if (valid) {
setStep((prev) => prev + 1);
}
};이 코드 참고해보시면 좋을 거 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✏️ 작업 내용
#️⃣ 연관된 이슈
#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
🤔 질문
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트