Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Portal to use ReactDOM.createPortal #2746

Closed
geoff-wasilwa opened this issue Apr 28, 2018 · 4 comments
Closed

Update Portal to use ReactDOM.createPortal #2746

geoff-wasilwa opened this issue Apr 28, 2018 · 4 comments

Comments

@geoff-wasilwa
Copy link

Steps

Mount a react component that has a modal form using enzyme and try searching for children nodes.

Expected Result

A call to wrapper.find(<content>) should return content with specified selector.

Actual Result

It's not possible to get modal content using enzyme wrapper.

Version

0.79.1

@levithomason
Copy link
Member

Agreed. We'll need to plan release timing. This will be part of a breaking change update that will require users to use React >=16 so they have the API.

There are other React 16 updates such as returning arrays and strings. This can really help us in some areas. Our Accordion has ugly markup and code due to not being able to return arrays.

At any rate, let's batch these changes into a major update. PRs welcome!

@levithomason
Copy link
Member

Workaround

In the meantime, if you have to mount and test Modal code you can find the elements in the DOM using conventional DOM APIs. This is in fact how our Moda tests have worked for years in the absence of a first-class Portal API.

@geoff-wasilwa
Copy link
Author

Thanks @levithomason, I actually ended up using this suggestion.

@layershifter
Copy link
Member

Was fixed in #2755.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants