mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
Merge pull request #16712 from yoyo837/fix-16706
fix shouldComponentUpdate
This commit is contained in:
commit
8a91c94c4c
@ -29,11 +29,17 @@ export default class ComponentDoc extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
const { location } = this.props;
|
||||
const { location: nextLocation } = nextProps;
|
||||
const { expandAll, showRiddleButton } = this.state;
|
||||
const { expandAll: nextExpandAll, showRiddleButton: nextShowRiddleButton } = nextState;
|
||||
|
||||
if (nextLocation.pathname === location.pathname) {
|
||||
if (
|
||||
nextLocation.pathname === location.pathname &&
|
||||
expandAll === nextExpandAll &&
|
||||
showRiddleButton === nextShowRiddleButton
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user