Feat: /form 공유 폼 컨텍스트(FormProvider) 설정 - #17
Merged
Conversation
/form 하위 페이지(prologue, question)가 클라이언트 내비게이션 동안 하나의 useForm 인스턴스를 공유하고, 모든 답변을 모아 한 번에 전송하기 위한 기반. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
의도 🔍
프롤로그(이름·생년월일·성별)와 질문 페이지의 답변을 하나의 API로 한 번에 전송하기 위해,
/form하위 페이지들이 값을 공유할 폼 컨텍스트를 세팅합니다.react-hook-form 공식 wizard 패턴은 스텝 간 상태 유지를 별도 스토어에 맡기지만, App Router에서는 공유 클라이언트 레이아웃이 내비게이션 간 유지되므로 레이아웃의
FormProvider하나로 같은 효과를 얻을 수 있습니다(추가 스토어 불필요).변경 사항 📝
react-hook-form@^7.85.0의존성 추가src/app/form/layout.tsx—useForm+FormProvider클라이언트 레이아웃./form/*페이지는useFormContext로 값에 접근src/features/form— 공유 폼 타입FormValues { name, birthDate(YYYY-MM-DD), gender }와 기본값. question 답변 필드는 이후 여기에 추가작업 결과 📸 (Optional)
아직
/form하위 페이지가 없어 렌더 결과는 없습니다. 후속 PR(프롤로그 플로우)에서/form/prologue가 이 컨텍스트로 이름·생년월일·성별을 채우는 것을 확인할 수 있습니다.🤖 Generated with Claude Code