경북대 FE_이효은 4주차 과제 Step3#95
Open
Hyoeunkh wants to merge 25 commits intokakao-tech-campus-2nd-step2:hyoeunkhfrom
Open
경북대 FE_이효은 4주차 과제 Step3#95Hyoeunkh wants to merge 25 commits intokakao-tech-campus-2nd-step2:hyoeunkhfrom
Hyoeunkh wants to merge 25 commits intokakao-tech-campus-2nd-step2:hyoeunkhfrom
Conversation
sjoleee
approved these changes
Jul 20, 2024
| </Route> | ||
| </Routes> | ||
| </AuthProvider> | ||
| <FormProvider {...methods}> |
There was a problem hiding this comment.
FormProvider가 필요 이상으로 상위에 위치하는 것은 아닐까요?
Comment on lines
23
to
49
| const onSubmit = (value: FormValues) => { | ||
| if (value.message && value.message.length > 100) { | ||
| alert('메시지는 100자 이내로 입력해주세요.'); | ||
| return; | ||
| } | ||
| if (!value.message) { | ||
| alert('메시지를 입력해주세요.'); | ||
| return; | ||
| } | ||
| if (value.cashReceipt && !value.number) { | ||
| alert('현금영수증 번호를 입력해주세요'); | ||
| return; | ||
| } | ||
| if (isNaN(Number(value.number))) { | ||
| alert('현금영수증 번호는 숫자로만 입력해주세요.'); | ||
| return; | ||
| } | ||
| alert('주문이 완료되었습니다.'); | ||
| }; | ||
|
|
||
| const totalPrice = data.detail.price.basicPrice * orderHistory.count; | ||
|
|
||
| return ( | ||
| <PaymentSectionWrapper> | ||
| <Title>결제 정보</Title> | ||
| <Divider color="#e6e6e6" /> | ||
| <form onSubmit={handleSubmit(onSubmit)}> |
There was a problem hiding this comment.
handleSubmit의 첫번째 인자는 onValid로, 유효성 검사를 통과할 경우 호출되는 콜백입니다.
hook-form의 유효성 검사에 의존하지 않고 사용법과 다르게 유효성을 검사하는 이유가 있을까요??
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.
안녕하세요 멘토님,
step3,4 제출합니다. 감사합니다 :)