Conversation
[fix/notepage-bug] 노트 페이지 버그 수정
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request replaces several instances of router.push with router.replace to optimize navigation history, renames the onClose prop to onCloseAction in the NoteCloseButton component, and adds a placeholder ModalPage component. A review comment correctly points out a potential runtime crash when calling .get() on searchParams if it is null during static rendering, suggesting the use of optional chaining as a safeguard.
| const page = searchParams.get('page') ?? '1'; | ||
| router.push(`/goal/${goalId}/note?page=${page}`); | ||
| router.replace(`/goal/${goalId}/note?page=${page}`); |
There was a problem hiding this comment.
useSearchParams()는 Next.js에서 정적 렌더링(Static Rendering) 환경이나 빌드 시점에 null을 반환할 수 있습니다. searchParams가 null인 상태에서 .get()을 호출하면 런타임 에러가 발생하여 애플리케이션이 크래시될 수 있습니다. 안전한 실행을 위해 옵셔널 체이닝(?.)을 사용하여 방어적으로 코드를 작성하는 것이 좋습니다.
| const page = searchParams.get('page') ?? '1'; | |
| router.push(`/goal/${goalId}/note?page=${page}`); | |
| router.replace(`/goal/${goalId}/note?page=${page}`); | |
| const page = searchParams?.get('page') ?? '1'; | |
| router.replace(`/goal/${goalId}/note?page=${page}`); |
Set CI environment variable and specify HOME directory for Playwright tests.
ci: playwright docker 이미지로 변경 및 push 트리거 제거
무엇을 변경했나요?
develop 브랜치를 main으로 머지
왜 이렇게 했나요?
(선택한 이유, 다른 방법 대신 이걸 선택한 이유)
리뷰어가 특히 봐줬으면 하는 부분
스크린샷 (UI 변경 시)