Open choigirang opened 6 months ago
value
를 인식하지 못함label
에서 직접 사용하는 방법
const listsLabel: { [key: string]: string } = {
home: '홈',
about: '소개',
skills: '기술',
project: '프로젝트',
contact: '연락망',
};
const listsIcon: { [key: string]: ReactNode } = {
홈:
// 주소 목록 const lists = ['home', 'about', 'skills', 'project', 'contact'];
return ( <Header $scroll={scroll}>
<Tabs
value={currentPath.pathname !== '/' ? currentPath.pathname : '/home'}
sx={{ '& .MuiTabs-indicator': { backgroundColor: 'transparent' } }}>
{lists.map(list => (
<TabList
key={list}
label={
<TabListWithIcons activeUrl={list === currentPath.pathname.replace('/', '')}>
{listsIcon[listsLabel[list]]}
<div className="labelKor">{listsLabel[list]}</div>
</TabListWithIcons>
}
value={'/' + list}
to={list}
component={Link}
onClick={() => scrollToPage(list)}
/>
))}
</Tabs>
</Header>
);
list
를 변경.return ( <Header $scroll={scroll}>
);