Repository navigation
fix(core): autocomplete, popper의 useLayoutEffect를 useEnhancedEffect로 교체 - #689
Conversation
React 18 peer 사용처에서 SSR 시 useLayoutEffect 경고가 발생하지 않도록 서버에서는 useEffect로 대체되는 내부 훅을 사용한다. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| 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:
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: 
5
-
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.
size-limit report 📦
|
🚀 Preview
|
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
🤖 Generated with Claude Code
Summary by CodeRabbit