mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:38:53 +08:00
修复一个 setState 给 unMounted 组件的问题
This commit is contained in:
parent
06e3eda803
commit
a7aa3f0528
@ -53,7 +53,8 @@ export class TooltipWrapper extends React.Component<
|
||||
};
|
||||
|
||||
target: HTMLElement;
|
||||
timer: number;
|
||||
timer: NodeJS.Timeout;
|
||||
moutned = true;
|
||||
constructor(props: TooltipWrapperProps) {
|
||||
super(props);
|
||||
|
||||
@ -76,6 +77,7 @@ export class TooltipWrapper extends React.Component<
|
||||
|
||||
componentWillUnmount() {
|
||||
clearTimeout(this.timer);
|
||||
this.moutned = false;
|
||||
}
|
||||
|
||||
getTarget() {
|
||||
@ -94,9 +96,10 @@ export class TooltipWrapper extends React.Component<
|
||||
|
||||
hide() {
|
||||
waitToHide = null;
|
||||
this.setState({
|
||||
show: false
|
||||
});
|
||||
this.moutned &&
|
||||
this.setState({
|
||||
show: false
|
||||
});
|
||||
}
|
||||
|
||||
getChildProps() {
|
||||
|
Loading…
Reference in New Issue
Block a user