Skip to content

fix(core): autocomplete, popper의 useLayoutEffect를 useEnhancedEffect로 교체 - #689

Merged
Sh031224 merged 1 commit into
mainfrom
feature/sh031224/ssr-layout-effect
Oct 24, 2026
Merged

Sh031224 merged 1 commit into
mainfrom
feature/sh031224/ssr-layout-effect

Conversation

@Sh031224

@Sh031224 Sh031224 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • @montage-ui/core는 peerDependency로 React 18을 지원하는데, React 18에서는 SSR 중 useLayoutEffect를 호출하면 useLayoutEffect does nothing on the server 경고가 발생합니다 (React 19에서는 제거됨).
  • AutocompleteList(asSelect 열림 시 선택 옵션 포커스)와 PopperContent(content z-index 동기화)가 useLayoutEffect를 직접 쓰고 있어, 이미 NoSsr에서 쓰는 내부 훅 useEnhancedEffect(서버에서는 useEffect로 대체)로 교체했습니다.
  • 클라이언트에서는 기존과 동일하게 useLayoutEffect로 동작합니다.
  • 커스텀 훅으로 바뀌면서 react-hooks/exhaustive-deps가 해당 effect를 검사하지 않아, 불필요해진 disable 주석을 제거했습니다 (의존성 배열은 그대로).

No Jira ticket — minor change.

Test plan

  • autocomplete / popover / tooltip 유닛 테스트 통과
  • React 18 + SSR 환경에서 Autocomplete, Popover 렌더 시 경고가 사라지는지 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 개선
    • 선택 옵션 초기화와 팝업 표시 과정의 내부 동작을 조정했습니다. 사용자에게 보이는 기능이나 인터페이스에는 변경이 없습니다. 이번 변경은 기존 선택 및 팝업 동작을 유지하며, 별도의 새 기능이나 사용 방법 변경을 포함하지 않습니다.

React 18 peer 사용처에서 SSR 시 useLayoutEffect 경고가 발생하지 않도록
서버에서는 useEffect로 대체되는 내부 훅을 사용한다.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Sh031224 Sh031224 added this to the 4.1.4 milestone Oct 24, 2026
@Sh031224 Sh031224 self-assigned this Oct 24, 2026
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dbf7052 and 5286232.

Files selected for processing: 2
  • packages/core/src/components/autocomplete/index.tsx
  • packages/core/src/components/popper/index.tsx

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

AutocompleteList와 PopperContent에서 useLayoutEffect를 내부 useEnhancedEffect로 변경했습니다. AutocompleteList 효과의 exhaustive-deps 비활성화 주석도 제거했습니다.

Changes

컴포넌트 효과 훅 변경

Layer / File(s) Summary
useEnhancedEffect 적용
packages/core/src/components/autocomplete/index.tsx, packages/core/src/components/popper/index.tsx
AutocompleteList의 초기 옵션 선택 효과와 PopperContent의 z-index 초기화 효과가 useEnhancedEffect를 사용합니다. React import를 변경했고, AutocompleteList 효과의 exhaustive-deps 비활성화 주석을 제거했습니다.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: Minimal · up to 52862

The hook replacement addresses SSR warnings without an identified client-side regression, so the change is mergeable.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 제목은 Autocomplete와 Popper에서 useLayoutEffect를 useEnhancedEffect로 교체한 주요 변경 사항을 정확하게 요약합니다.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@montage-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@montage-ui/core 2.49 KB (0%)
@montage-ui/icon 3.97 KB (0%)
@montage-ui/lottie 68 B (0%)
@montage-ui/theme 156 B (0%)
@montage-ui/engine 324 B (0%)
@montage-ui/nextjs 149 B (0%)

@montage-actions

Copy link
Copy Markdown
Contributor

🚀 Preview

Last commit5286232
Preview URLhttps://dev-montage.wanted.co.kr/5286232

@Sh031224
Sh031224 merged commit 0f33e59 into main Oct 24, 2026
12 checks passed
@Sh031224
Sh031224 deleted the feature/sh031224/ssr-layout-effect branch October 24, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant