You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActivityDemoPage에서 사이드바를 숨길 때 CSS display: 'none'을 사용하면 Sidebar 컴포넌트가 마운트 해제되지 않아 useEffect의 정리 함수가 실행되지 않습니다. 이는 Sidebar.tsx의 useEffect 주석에 명시된 경계의 정리 동작과 모순되며, setInterval이 숨겨진 상태에서도 계속 실행되어 메모리 누수를 유발할 수 있습니다. showSidebar 상태에 따라 Sidebar 컴포넌트를 조건부로 렌더링하여 useEffect 정리가 올바르게 작동하도록 해야 합니다.
Why: The suggestion correctly identifies that using display: 'none' prevents the Sidebar component's useEffect cleanup from running, leading to a setInterval memory leak. While page.tsx explicitly states the fallback preserves DOM/state, Sidebar.tsx's useEffect is designed to demonstrate cleanup, creating a contradiction in the demo's purpose.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement
Description
새로운 활동 데모 페이지 추가.
확장 가능한 사이드바 컴포넌트 구현.
상태 보존 탭 예제 컴포넌트 포함.
홈 페이지에 데모 페이지 링크 추가.
Diagram Walkthrough
File Walkthrough
Sidebar.tsx
활동 데모 사이드바 컴포넌트 추가apps/web/app/activity-demo/Sidebar.tsx
isExpanded상태를 관리하는useState훅 사용.useEffect를 사용하여 1초마다 시간을 업데이트.경계 내에서 효과 정리 동작을 시연.TabsExample.tsx
활동 데모 탭 예제 컴포넌트 추가apps/web/app/activity-demo/TabsExample.tsx
useState훅을 사용하여 탭 인터페이스 구현.Contact컴포넌트 포함.page.tsx
활동 API 데모 페이지 추가apps/web/app/activity-demo/page.tsx
Sidebar및TabsExample컴포넌트를 렌더링하는 메인 데모 페이지.API에 대한 설명 및 대체(fallback) 방식 제공.API 사용 시 주의사항 명시.page.tsx
홈 페이지에 활동 데모 링크 추가apps/web/app/page.tsx
/activity-demo경로로 이동하는 새 링크 추가.