【发布时间】:2021-04-14 13:12:44
【问题描述】:
<MenuItem
component={NavLink}
to={to}
key={text}
selected={selectedNavIndex === index}
**// compiler complaining about match of any type**
isActive={match => {
if (match) {
onNavSelectHandler(index);
return true;
} else {
return false;
}
}}
>
<StyledListItemIcon>
<StyledIcon as={icon} width={width} />
</StyledListItemIcon>
{text && isOpen && <ListItemText primary={text} />}
</MenuItem>
我正在尝试在打字稿项目中使用react-router的isActive功能,但我无法正确输入...
【问题讨论】:
标签: reactjs typescript react-router