scss -> styled component 변환, footer 컴포넌트화, 버그수정 2개 by yongchanson · Pull Request #24 · JCTG-JavaScript-Coding-Test-Group/SolutionBank
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문 남겨주셨던
footer의 경우 각 component에 {repoLink}라는 props를 넘겨주는 형태인데, 이것을 전역으로 관리하거나 한번에 보내주는 방법은 없을까요? <ThemeProvider>의 {theme}처럼 사용하고 싶습니다.
에 대해서 답변을 드릴게요!
제 생각에는 repoLink는 상수값이기 때문에 props 보다는 `const REPO_LINK = 'https~~' 로 다른 곳에 선언을 해두고 import 해서 사용하는 것이 더 간단한 방법일 것 같아요!
ThemeProvider의 theme은 styled component 내부에서 사용될 props를 위해 사용되는 것인데 repoLink는 styled componenet가 아닌 그냥 React component를 위해 사용되는 것으로 보입니다!
만약 스타일적으로 링크 텍스트를 활용할 일이 있다면 theme.js 의 theme 객체에 속성으로 추가하면 될 것 같습니다!