CEC-3071: Fixed Duplicate datascope menu (#232)
* CEC-3071: Fixed Duplicate datascope menu * Mde item type dynamic Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
committed by
GitHub
parent
2d298368c5
commit
61982c4ba5
@@ -9,10 +9,13 @@ function ListItemLink(props) {
|
||||
const { icon, primary, to } = props;
|
||||
|
||||
const renderLink = React.useMemo(
|
||||
() =>
|
||||
React.forwardRef((itemProps, ref) => (
|
||||
<RouterLink to={to} ref={ref} {...itemProps} />
|
||||
)),
|
||||
() => {
|
||||
if (to) {
|
||||
return React.forwardRef((itemProps, ref) => (
|
||||
<RouterLink to={to} ref={ref} {...itemProps} />
|
||||
))
|
||||
}
|
||||
},
|
||||
[to]
|
||||
);
|
||||
|
||||
@@ -27,7 +30,7 @@ function ListItemLink(props) {
|
||||
ListItemLink.propTypes = {
|
||||
icon: PropTypes.element,
|
||||
primary: PropTypes.string.isRequired,
|
||||
to: PropTypes.string.isRequired,
|
||||
to: PropTypes.string,
|
||||
};
|
||||
|
||||
export default ListItemLink;
|
||||
|
||||
Reference in New Issue
Block a user