fix(Menu): remove unexpected re-render, which causes flash and shake when collapsed

This commit is contained in:
zy410419243 2019-03-25 13:53:26 +08:00
parent 3dc031625f
commit ad54d23a44

View File

@ -188,6 +188,7 @@ class Menu extends React.Component<MenuProps, MenuState> {
onClick(e);
}
};
handleOpenChange = (openKeys: string[]) => {
this.setOpenKeys(openKeys);
@ -217,6 +218,9 @@ class Menu extends React.Component<MenuProps, MenuState> {
if (this.context.siderCollapsed !== undefined) {
return this.context.siderCollapsed;
}
if (this.contextSiderCollapsed) {
return false;
}
return inlineCollapsed;
}