From 1caabed1dfe50e386cf023e66ec3f030be5b9ac4 Mon Sep 17 00:00:00 2001 From: Dan Hayden Date: Thu, 10 Aug 2017 11:29:23 +0100 Subject: [PATCH] [fixed] `Uncaught TypeError: Cannot read property 'state' of null` when unmouting --- src/components/Modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Modal.js b/src/components/Modal.js index 275c164f..0786f355 100644 --- a/src/components/Modal.js +++ b/src/components/Modal.js @@ -127,7 +127,7 @@ export default class Modal extends Component { } componentWillUnmount() { - if (!this.node) return; + if (!this.node || !this.portal) return; const state = this.portal.state; const now = Date.now();