Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
공통 컴포넌트의 본질
컴포넌트 개수 = 함수 개수 x 그 함수 사용하는 ui 개수
컴포넌트 개수 = 함수 개수 x 1 --> 컴포넌트 사용의 이유
분명하고 직관적인 이름: 찾을 수 있는 이름
GNB -> GlobalNavigationBar파일을 열어보지 않아도 Link 컴포넌트 프로퍼티를 쓸 수 있구나 알 수 있습니다.
구체적인 기능보다 재사용 가능한 형태에 초점
재사용되는 형태는 많은 사람들이 이해하고 있으며 + �특정 사례를 위한 prop과 다른 속성이 '어떻게' 사용했는지도 알려줍니다.
<LogoutButton/>로그아웃 버튼이구나
<BasicButton onclick={handleLogout} theme={'secondary'}>로그아웃<BasicButton/>BasicButton 모양의 secondary 테마 로그아웃 버튼이구나.
+@) 옆에는 primary theme의 다른 BasicButton이 있구나.
구조적 일관성
RootHeader가 RootLogo, RootNav를 담고 있지만 파일은 모두 동일계층에 존재.
-> RootNav는 RootHeader와 같은 계층의 요소임을 뜻하는 Root를 떼고 공통 컴포넌트가 되거나, RootHeader 폴더 안으로 정리되면 좋음 (사실상 RootHeaderLogo, RootHeaderNav)
Beta Was this translation helpful? Give feedback.
All reactions