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:
Alexander Andrews
2022-11-07 12:38:32 -05:00
committed by GitHub
parent 2d298368c5
commit 61982c4ba5
6 changed files with 838 additions and 4380 deletions

View File

@@ -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;