Using React 16 portals
React 16 now officially supports portals. Is there any plan to move from a custom implementation?
Portal documentation: https://reactjs.org/docs/portals.html
Do they use a custom implementation? From what the code says(https://github.com/reactjs/react-modal/blob/master/src/components/Modal.js#L11-L14), they look for react 16 and use the portals already. However, I am having an issue testing with that and enzyme; issue here (https://github.com/airbnb/enzyme/issues/1150). I'm wondering if there's a way for us to say we don't want to use portals if we don't want to (or if other libraries are having issues with it)
@brmenchl react-modal already has support for react 16 on version v3+.
@comfroels I think the best way (or at least for now) is to define an alias on your compiler config to use a dummy proxy component (which just returns the children or a <div>{children}</div>). This way you will "remove" the Modal from your tests.
Ref: Webpack resolve config Ref: Rollup alias plugin
Another way would be to make the modal content a component itself.
Here is an example: https://codesandbox.io/s/lyqov0lowl
I'm close this for clean up. @comfroels Feel free to open a new issue or follow any other previously opened about testing. Thank you!