Browse Source
Merge pull request #17657 from ant-design/fix-set-state-warning
fix: Cannot update during an existing state transition
pull/17673/head
偏右
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
0 additions and
5 deletions
-
components/menu/__tests__/index.test.js
-
components/menu/index.tsx
|
|
@ -569,7 +569,6 @@ describe('Menu', () => { |
|
|
|
.instance() |
|
|
|
.getMenuOpenAnimation(''), |
|
|
|
).toBe(''); |
|
|
|
expect(wrapper.find('InternalMenu').state().switchingModeFromInline).toBe(false); |
|
|
|
}); |
|
|
|
|
|
|
|
it('MenuItem should not render Tooltip when inlineCollapsed is false', () => { |
|
|
|
|
|
@ -276,10 +276,6 @@ class InternalMenu extends React.Component<InternalMenuProps, MenuState> { |
|
|
|
// submenu should hide without animation
|
|
|
|
if (this.state.switchingModeFromInline) { |
|
|
|
menuOpenAnimation = ''; |
|
|
|
this.setState({ |
|
|
|
switchingModeFromInline: false, |
|
|
|
}); |
|
|
|
// this.switchingModeFromInline = false;
|
|
|
|
} else { |
|
|
|
menuOpenAnimation = 'zoom-big'; |
|
|
|
} |
|
|
|