-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
emotionversion: 9.2.5reactversion: 16.8.2
Relevant code:
const popupWindow = window.open("", target, openOptionsToString(options));
popupWindowRef.current = popupWindow;
// I need to do this because my styles aren't injected into `popupWindow`.
popupWindow.document.head.innerHTML = window.document.head.innerHTML;
React.createPortal(props.children, popupWindowRef.current.document.body)What you did:
Given a component and the snippet above,
<ShowInNewWindow>
hello world
</ShowInNewWindowThe "hello world" rendered in the new window is rendered without any styling whatsoever, even though the page that triggered the new window has styles added to its <head>.
Full reproduction on CodeSandbox
Expected
The contents of the new window receive the same styling as the source window.
What I find particularly interesting is that the components on the new window have computed classNames – so that part works. It's just that there are no styles injected into <head> that is throwing me off.
cc @stereobooster who showed me this issue
Metadata
Metadata
Assignees
Labels
No labels