From 3802c153a7786fae9dc9eb20d5a45bed4a2c8c27 Mon Sep 17 00:00:00 2001 From: RabbitDoge <72658581+RabbitDoge@users.noreply.github.com> Date: Wed, 3 Mar 2021 12:13:45 +0900 Subject: [PATCH] fix: Re render on mobile (#201) --- src/widgets/Menu/components/MenuEntry.tsx | 5 ++--- src/widgets/Menu/components/MenuLink.tsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/widgets/Menu/components/MenuEntry.tsx b/src/widgets/Menu/components/MenuEntry.tsx index e0b426ec5..8f0e293af 100644 --- a/src/widgets/Menu/components/MenuEntry.tsx +++ b/src/widgets/Menu/components/MenuEntry.tsx @@ -66,7 +66,6 @@ MenuEntry.defaultProps = { role: "button", }; -const MenuEntryMemo = React.memo(MenuEntry, () => true); -const LinkLabelMemo = React.memo(LinkLabel, () => true); +const LinkLabelMemo = React.memo(LinkLabel, (prev, next) => prev.isPushed === next.isPushed); -export { MenuEntryMemo as MenuEntry, LinkLabelMemo as LinkLabel }; +export { MenuEntry, LinkLabelMemo as LinkLabel }; diff --git a/src/widgets/Menu/components/MenuLink.tsx b/src/widgets/Menu/components/MenuLink.tsx index d08c37a97..3db29953a 100644 --- a/src/widgets/Menu/components/MenuLink.tsx +++ b/src/widgets/Menu/components/MenuLink.tsx @@ -10,4 +10,4 @@ const MenuLink: React.FC> = ({ href, ... return ; }; -export default React.memo(MenuLink, () => true); +export default MenuLink;