mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
fix shouldComponentUpdate
This commit is contained in:
parent
a1e593b7e7
commit
d9ede1b4a5
@ -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