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

menu-surface Hoist anti-pattern? #628

Closed
aluminick opened this issue Jan 22, 2019 · 5 comments
Closed

menu-surface Hoist anti-pattern? #628

aluminick opened this issue Jan 22, 2019 · 5 comments

Comments

@aluminick
Copy link
Contributor

aluminick commented Jan 22, 2019

document.body.appendChild(
menuSurfaceElement.parentElement.removeChild(menuSurfaceElement)
);

Is this an anti-pattern? I think portal should be used on this one.

@aluminick aluminick changed the title Hoist anti-pattern? menu-surface Hoist anti-pattern? Jan 22, 2019
@moog16
Copy link

moog16 commented Jan 22, 2019

@aluminick I am not familiar with react.portals, but after reading the docs I believe you to be correct. Would you like to take a crack at it?

@aluminick
Copy link
Contributor Author

@moog16 sure. Thanks.

@aluminick
Copy link
Contributor Author

@moog16 Sorry, I forgot about this issue.
I've hoisted menu-surface using ReactDOM Portal but it has to be wrapped. And the tests are failing.

@moog16
Copy link

moog16 commented Feb 12, 2019

Oh great - do you have a branch already? Whenever you're ready please feel free to open a PR.

@moog16
Copy link

moog16 commented Mar 15, 2019

Closed with #693

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

No branches or pull requests

2 participants