diff --git a/src/Popup.jsx b/src/Popup.jsx index 76824ca40..0ee32baa4 100644 --- a/src/Popup.jsx +++ b/src/Popup.jsx @@ -169,7 +169,7 @@ module.exports = React.createClass({ , duration = this.props.duration; this.animate(el, offset, duration, 'ease', () => - this.setState({ status: CLOSED }, () => { + this.safeSetState({ status: CLOSED }, () => { this.props.onClose() }) ) diff --git a/src/mixins/FocusMixin.js b/src/mixins/FocusMixin.js index f500d779b..937b99fdf 100644 --- a/src/mixins/FocusMixin.js +++ b/src/mixins/FocusMixin.js @@ -18,7 +18,8 @@ export default function FocusMixin({ willHandle, didHandle }) { if (focused !== inst.state.focused) { notify(handler, event) - inst.setState({ focused }) + if (inst.isMounted()) + inst.setState({ focused }) } }) })