Skip to content
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

refactor: 방 생성, 관리 페이지 렌더링 최적화 #508

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

bbearcookie
Copy link
Member

🧩 이슈 번호

✅ 작업 사항

  • 방 생성 페이지 렌더링 최적화
  • 방 관리 페이지 렌더링 최적화
  • 방 생성 페이지에서 StepTemplate 작성하는 방식으로 리팩토링

👩‍💻 공유 포인트 및 논의 사항

기존

watch 리렌더링

현재

watch 최적화 결과

기존에 watch 로 값의 변화를 감지하고 있다 보니, FormProvider 로 감싸진 전체 영역이 리렌더링되는 현상이 발생했었는데요,
여기에 useWatch를 사용하는 방식으로 수정하여 값을 구독하는 컴포넌트만 리렌더링되도록 했어요.

추가로, 페이지 내에 존재하는 컴포넌트를 분리하기에는 애매하지만 값이 변경되었을 때 전체가 리렌더링 되는 것이 아니라 특정 JSX만 리렌더링하고 싶은 경우에는 Controller를 사용했어요.
(ex. TimePicker)

Reference: https://github.com/orgs/react-hook-form/discussions/7558

@bbearcookie bbearcookie added ☁️ FE 프론트 레포지토리에서의 작업 ♻️ refactor 기존의 코드 개선 작업 labels Mar 1, 2024
@bbearcookie bbearcookie self-assigned this Mar 1, 2024
@bbearcookie bbearcookie merged commit 2760f47 into dev Mar 5, 2024
2 checks passed
@bbearcookie bbearcookie deleted the refactor/#507/room-create-usewatch branch March 5, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️ FE 프론트 레포지토리에서의 작업 ♻️ refactor 기존의 코드 개선 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

방 생성, 관리 페이지 렌더링 최적화
1 participant