Fix: findDOMNode -> nodeRef 부여 방식으로 변경#471
Hidden character warning
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthrough
Changes
Sequence Diagram(s)sequenceDiagram
participant Router
participant TransitionRoutes
participant CSSTransition
participant DOMNode
Router->>TransitionRoutes: 경로(pathname) 변경
TransitionRoutes->>TransitionRoutes: getNodeRef(pathname)로 ref 생성/획득
TransitionRoutes->>CSSTransition: nodeRef 전달
CSSTransition->>DOMNode: ref로 직접 접근 (findDOMNode 없이)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 사항 없음) Possibly related PRs
Suggested labels
Suggested reviewers
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
✅ Vitest Test Results📉 Coverage Warnings
🎉 All tests passed!Great job! All 177 tests are working correctly across 22 test files. 🔗 Quick Actions
🤖 Generated by GitHub Actions at 2025-08-08T09:15:03.478Z |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Common/TransitionRoutes.tsx(3 hunks)
🔇 Additional comments (4)
src/components/Common/TransitionRoutes.tsx (4)
1-9: import 확장 LGTM추가된 FC/ReactElement/RefObject/createRef/useRef 모두 실제로 사용되고 있어 불필요한 import 없습니다. PR 목적과 정합적입니다.
49-49: childFactory 파라미터 타입 ReactElement로 통일 — OK타입 정리는 일관성에 도움이 됩니다. 현재 사용 맥락에서 문제 없습니다. (기존 classNames를 exit child에도 적용하려는 패턴과도 맞습니다.)
65-65: CSSTransition에 nodeRef 전달 — findDOMNode 제거 목적 달성nodeRef를 명시적으로 전달했기 때문에 react-transition-group이 findDOMNode를 호출하지 않습니다. 의도대로 잘 적용되었습니다.
70-70: div에 ref 연결 적절 — 실제 DOM 노드 참조 보장nodeRef를 transition 대상 실제 DOM(div.transition-page-wrapper)에 연결해 전환 클래스가 올바른 노드에 적용됩니다.
Related issue 🛠
Work Description ✏️
TransitionRoutes내부 findDOMNode 사용 제거Uncompleted Tasks 😅
To Reviewers 📢
CSSTransition에 별도의 nodeRef가 할당되지 않아, findDOMNode로 자식의 실제 DOM을 탐색중이었습니다.div.transition-page-wrapper였기 때문에,findDOMNode로 항상 div를 정확히 탐색할 수 있어 페이지 전환 애니메이션 자체는 정상적으로 동작하고 있었습니다.nodeRef를 경로 키(location.pathname)별로 관리하도록Map+createRef를 사용해 CSSTransition에nodeRef를 전달하고, 해당 ref를 실제 DOM 에 연결하는 방식으로 기존 로직을 유지하면서findDOMNode를 사용하지 않도록 변경했습니다.Summary by CodeRabbit