The Modal component is throwing an error in componentWillUnmount after upgrading React to v16-beta.
@nextModal component as before.
After some research, it seems this is directly related to the usage of renderSubtreeIntoContainer method to set this.portal in Modal. This is described in depth in https://github.com/facebook/react/issues/10309. Since portal is never set correctly, assuming its existence in componentWillUnmount causes the error.
Hi @jakepeyser #474 is available. A new version will be available today.
Brilliant. Thanks @diasbruno
Released v2.2.3.
In my case, ReactModalPortal DOM elements are leaked due to this. When this.portal is undefined, things do not get cleaned up. This can be reproduced in my case with React 16 only - it works fine with React 15.x. Can you please check your DOM and see if things get cleaned up?
@uwolfer [email protected] is available now. Let me know if this still happens.
To install, use npm install react-modal@next.
@diasbruno: Thank you, this fixes my issue.