Open oscmedgon opened 4 years ago
I did a small change to support it in my case, but I want to understand why is not supported
const MainMenu = ({ mainMenu, mainMenuItems, isMobileMenu }) => { const menu = mainMenu.slice(0) !isMobileMenu && menu.splice(mainMenuItems) return menu.map((menuItem, index) => { const urlRegex = /^(https?:\/\/)?([\da-z\.-]+\.[a-z\.]{2,6}|[\d\.]+)([\/:?=&#]{1}[\da-z\.-]+)*[\/\?]?$/im const isAbsoluteUrl = menuItem.path.match(urlRegex); if (isAbsoluteUrl) { return ( <li key={index}> <a href={menuItem.path} target='_top'>{menuItem.title}</a> </li> ) } else { return ( <li key={index}> <Link to={menuItem.path}>{menuItem.title}</Link> </li> ) } }) }
I did a small change to support it in my case, but I want to understand why is not supported