-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Description
Summary:
Currently I don't think react-modal is compatible with code splitting using loadable-components because of needing to call Modal.setAppElement()
. The issue is that if we load the Modal
element like this:
const Modal = loadable(() => import('react-modal'))
...then Modal
won't have resolved at runtime when we call Modal.setAppElement
.
My suggestion is to call setAppElement
from within the constructor if we pass an appElement
prop to the Modal
.
Thanks for maintaining this repo, and please let me know if a PR to do the above would be welcomed, as I'd love to contribute!