From cdfb34e4b1be6f44dd99ab7b52a3f2fd1a207091 Mon Sep 17 00:00:00 2001 From: RaoHai Date: Tue, 17 May 2016 15:14:31 +0800 Subject: [PATCH 1/2] determine whether this.refs exisits --- src/Dialog.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Dialog.jsx b/src/Dialog.jsx index 33fdc92a..8829d820 100644 --- a/src/Dialog.jsx +++ b/src/Dialog.jsx @@ -102,7 +102,9 @@ const Dialog = React.createClass({ }, onAnimateLeave() { - this.refs.wrap.style.display = 'none'; + if (this.refs.wrap) { + this.refs.wrap.style.display = 'none'; + } this.props.onAfterClose(); }, From 47b217495cfc336ee7f4a988a612c69992a1c6af Mon Sep 17 00:00:00 2001 From: RaoHai Date: Tue, 17 May 2016 15:18:20 +0800 Subject: [PATCH 2/2] determine whether this.refs exisits --- src/Dialog.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dialog.jsx b/src/Dialog.jsx index 8829d820..dba26f9c 100644 --- a/src/Dialog.jsx +++ b/src/Dialog.jsx @@ -102,7 +102,7 @@ const Dialog = React.createClass({ }, onAnimateLeave() { - if (this.refs.wrap) { + if (ReactDOM.findDOMNode(this.refs.wrap)) { this.refs.wrap.style.display = 'none'; } this.props.onAfterClose();