Skip to content

Fix: findDOMNode -> nodeRef 부여 방식으로 변경#471

Merged
MrMirror21 merged 3 commits into
devfrom
fix/470-finddomnode-제거
Aug 8, 2025

Hidden character warning

The head ref may contain hidden characters: "fix/470-finddomnode-\uc81c\uac70"
Merged

Fix: findDOMNode -> nodeRef 부여 방식으로 변경#471
MrMirror21 merged 3 commits into
devfrom
fix/470-finddomnode-제거

Conversation

@MrMirror21

@MrMirror21 MrMirror21 commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

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

  • 버그 수정
    • 경로 전환 시 발생하던 경고 메시지를 방지하기 위해 트랜지션 애니메이션 처리 방식을 개선하였습니다.
    • 내부적으로 명시적인 노드 참조 방식을 적용하여 안정성이 향상되었습니다.

@MrMirror21 MrMirror21 requested a review from naarang August 8, 2025 09:07
@MrMirror21 MrMirror21 self-assigned this Aug 8, 2025
@MrMirror21 MrMirror21 added this to Giggle Aug 8, 2025
@MrMirror21 MrMirror21 added the 🐞 BugFix Something isn't working label Aug 8, 2025
@coderabbitai

coderabbitai Bot commented Aug 8, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

TransitionRoutes 컴포넌트에서 findDOMNode 사용을 제거하고, 각 경로별로 ref를 명시적으로 관리하는 로직이 추가되었습니다. 이를 위해 MapuseRef를 활용하여 노드 참조를 직접 전달하도록 변경되었습니다. 컴포넌트 외부 API는 변경되지 않았습니다.

Changes

Cohort / File(s) Change Summary
TransitionRoutes 리팩토링
src/components/Common/TransitionRoutes.tsx
findDOMNode 제거, 경로별 ref 직접 관리, nodeRef를 CSSTransition에 명시적으로 전달하는 로직 추가

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 없이)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
findDOMNode 제거 (#470)

Assessment against linked issues: Out-of-scope changes

(해당 사항 없음)

Possibly related PRs

Suggested labels

✨ Feature

Suggested reviewers

  • ohofront
  • naarang

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 details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c779df and 3755cd0.

📒 Files selected for processing (1)
  • src/components/Common/TransitionRoutes.tsx (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/470-finddomnode-제거

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

github-actions Bot commented Aug 8, 2025

Copy link
Copy Markdown

✅ Vitest Test Results

**Status:** ALL TESTS PASSED
**Runtime:** 2.41s

### 📊 Test Summary
```
Test Files: 22 files
Total:      177 tests
Passed:     177 tests
Failed:     0 tests
Skipped:    0 tests
```

📉 Coverage Warnings

⚠️ Lines coverage is below 80% (0%)
⚠️ Functions coverage is below 80% (0%)
⚠️ Branches coverage is below 80% (0%)
⚠️ Statements coverage is below 80% (0%)

🎉 All tests passed!

Great job! All 177 tests are working correctly across 22 test files.

🔗 Quick Actions

  • [🧪 Run tests locally](pnpm test)
  • [📊 Run coverage locally](pnpm test:coverage)
  • [🎨 Open Vitest UI](pnpm test:ui)
  • ⚙️ View workflow logs

🤖 Generated by GitHub Actions at 2025-08-08T09:15:03.478Z

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52f7048 and 0c779df.

📒 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)에 연결해 전환 클래스가 올바른 노드에 적용됩니다.

Comment thread src/components/Common/TransitionRoutes.tsx
@MrMirror21 MrMirror21 merged commit 4e65e3d into dev Aug 8, 2025
2 of 3 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Giggle Aug 8, 2025
@MrMirror21 MrMirror21 deleted the fix/470-finddomnode-제거 branch August 9, 2025 02:13
@MrMirror21 MrMirror21 linked an issue Aug 9, 2025 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[fix] - findDOMNode 제거

1 participant