From 56e3384c6b193f6387ad3160df3f6128cbd78241 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Wed, 2 May 2018 14:44:53 +0800 Subject: [PATCH] Revert "MenuItem: avoid rendering Tooltip unless necessary (#9636)" This reverts commit 0754845aff7ac3960927c3133deda78accb8f2ed. Conditional rendering will break the transition animation, since React will create new DOM node when inlineCollapsed changges. Fix https://github.com/react-component/menu/issues/139 --- components/menu/MenuItem.tsx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 053791ab2f..542b8bd67f 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -18,17 +18,13 @@ class MenuItem extends React.Component { render() { const { inlineCollapsed } = this.context; const props = this.props; - const item = ; - if (inlineCollapsed && props.level === 1) { - return - {item} - ; - } - return item; + return + + ; } }