From f473b000f7cfd3a83d8f04b729cdb2b7c2e0136d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 22 Oct 2018 20:04:34 +0800 Subject: [PATCH] fix #2630,Fix problems with first level menu matching --- src/components/SiderMenu/BaseMenu.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/SiderMenu/BaseMenu.js b/src/components/SiderMenu/BaseMenu.js index 76c21bc0..0fc635de 100644 --- a/src/components/SiderMenu/BaseMenu.js +++ b/src/components/SiderMenu/BaseMenu.js @@ -24,10 +24,13 @@ const getIcon = icon => { return icon; }; -export const getMenuMatches = memoizeOne( - (flatMenuKeys, path) => flatMenuKeys.filter(item => item && pathToRegexp(item).test(path)), - isEqual -); +export const getMenuMatches = (flatMenuKeys, path) => + flatMenuKeys.filter(item => { + if (item) { + return pathToRegexp(item).test(path); + } + return false; + }); export default class BaseMenu extends PureComponent { constructor(props) { -- GitLab