Skip to content

Commit

Permalink
fix: will not unmount react dom when visible is hidden for loading an…
Browse files Browse the repository at this point in the history
…d toast. fix #710
  • Loading branch information
JeromeLin committed Jul 15, 2021
1 parent 195cf54 commit defc4eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/zarm/src/loading/index.tsx
Expand Up @@ -94,6 +94,7 @@ export default class Loading extends PureComponent<LoadingProps, {}> {
afterClose = () => {
const { afterClose } = this.props;
if (Loading.zarmLoading) {
ReactDOM.unmountComponentAtNode(Loading.zarmLoading);
Loading.loadingContainer.removeChild(Loading.zarmLoading);
Loading.zarmLoading = null;
}
Expand Down
1 change: 1 addition & 0 deletions packages/zarm/src/toast/index.tsx
Expand Up @@ -112,6 +112,7 @@ export default class Toast extends Component<ToastProps, any> {
afterClose = () => {
const { afterClose } = this.props;
if (Toast.zarmToast) {
ReactDOM.unmountComponentAtNode(Toast.zarmToast);
Toast.toastContainer.removeChild(Toast.zarmToast);
Toast.zarmToast = null;
}
Expand Down

0 comments on commit defc4eb

Please sign in to comment.