Skip to content

Commit

Permalink
fix(modal): Modal.close not work
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaMaid committed Jan 22, 2019
1 parent 2cffbda commit de9e8a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as classNames from 'classnames';
import {IBaseComponent} from '../template/component';
import Button from '../Button';
import Icon from '../Icon';
import { render } from 'react-dom';
import { render, unmountComponentAtNode } from 'react-dom';
import { Dialog } from '../utils/';
import { IButtonProps } from '../Button/Button';

Expand Down Expand Up @@ -257,6 +257,7 @@ const renderModal = (props: IModalComponentProps) => {

const closeModal = (obj: {div: HTMLDivElement, modal: JSX.Element}) => {
try {
unmountComponentAtNode(obj.div);
document.body.removeChild(obj.div);
} catch (error) {
return false;
Expand Down

0 comments on commit de9e8a9

Please sign in to comment.