Refactor/#101 맛집 생성 페이지(PlaceNewPage) FormProvider 도입#102
Merged
leeleeleeleejun merged 5 commits intodevelopfrom Feb 6, 2026
Merged
Refactor/#101 맛집 생성 페이지(PlaceNewPage) FormProvider 도입#102leeleeleeleejun merged 5 commits intodevelopfrom
leeleeleeleejun merged 5 commits intodevelopfrom
Conversation
|
Caution Review failedThe pull request is closed. 개요FormProvider를 도입하여 react-hook-form 컨텍스트를 노출하고, 여러 스텝 컴포넌트에서 prop 기반의 form 제어를 제거하여 useFormContext로 대체합니다. next.config.ts에 원격 이미지 패턴을 추가합니다. 변경 사항
예상 코드 리뷰 시간🎯 3 (Moderate) | ⏱️ ~25 minutes 관련 이슈
관련 PR
제안 레이블
제안 리뷰어
토끼의 시
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
#️⃣연관된 이슈
📝작업 내용
맛집 생성 페이지(
PlaceNewPage)의 코드 구조를 개선하기 위해react-hook-form의 **FormProvider**를 도입했습니다.1. FormProvider 도입
기존 문제
최상위 컴포넌트에서
useForm을 호출하고, 반환된 객체들(control,setValue,getValues,trigger등)을 모든 하위 단계(Step) 컴포넌트에 일일이 Props로 전달해야 하는 번거로움이 있었습니다.해결
FormProvider로 폼 컨텍스트를 주입하고, 하위 컴포넌트에서는useFormContext훅을 사용하여 필요한 메서드를 직접 가져다 쓰도록 변경했습니다.결과
PlaceNewPage의 코드가 훨씬 간결해졌으며, 불필요한 Props 전달이 사라졌습니다.2. 검증 로직의 위치 이동 (응집도 향상)
기존
Description의 유효성 검사(
trigger) 로직이 부모 컴포넌트(PlaceNewPage)의nextStep함수 내부에 섞여 있었습니다.변경
Description등 각 단계 컴포넌트 내부로 검증 로직을 이동시켰습니다.효과
부모는 **"페이지의 흐름(Flow)"**만 관리하고, 자식은 **"자신의 데이터 검증(Validation)"**을 스스로 책임지도록 하여 관심사를 명확히 분리했습니다.
스크린샷 (선택)
스크린샷 (선택)
💬리뷰 요구사항(선택)
Summary by CodeRabbit
릴리즈 노트
Refactor
New Features