fix: 🐛 Affix state update on unmounted component (#22790)

close #22683
This commit is contained in:
偏右 2020-03-31 21:25:40 +08:00 committed by afc163
parent 44d74415bc
commit 0c1f181957

View File

@ -116,6 +116,8 @@ class Affix extends React.Component<AffixProps, AffixState> {
clearTimeout(this.timeout);
removeObserveTarget(this);
(this.updatePosition as any).cancel();
// https://github.com/ant-design/ant-design/issues/22683
(this.lazyUpdatePosition as any).cancel();
}
getOffsetTop = () => {