Portal should not be wrapped in a div when the target is document.body #1865
ivanjeremic
started this conversation in
Ideas
Replies: 1 comment
-
|
It might be not ideal, but as a workaround you could alter the style of this div to get what you need. Just to give you some idea: let ref: HTMLDivElement | undefined;
createEffect(() => {
if (ref) {
ref.style.display = "contents";
// or add a class
}
});
return (
<Portal ref={ref}>{/* Some component */}</Portal>
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Portal should not be wrapped in a
divwhen the target isdocument.body.Same as with
<head>when the target is directly thedocument.bodythe portal markup should not be wrapped in adivbecause we want body > now our markup.If this is not possible for any technical reason (I don't see any), consider adding an option for turning off the wrapper div.
Beta Was this translation helpful? Give feedback.
All reactions