You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to use react-toastify in a multi-window app (windows are open with window.open and render a subtree using React portals). But the styles from react-toastify are not injected in the other windows, making toasts only work in the main window.
React-toastify should detect the current window containing the toast container (element.ownerDocument.defaultView) and inject the styles there if they haven’t been injected already in that window. Alternatively, expose an injectStyles function (with a window_ argument) to make it possible to inject the styles in a different window.
(already reported as #902 which was closed because it was supposed to be fixed in v11, but it isn’t)
The text was updated successfully, but these errors were encountered:
I’m using the following as a workaround for now, where I’ve configured Webpack to import the contents of the CSS file into a string, and I then use injectStyle for each new window I create:
I’m trying to use react-toastify in a multi-window app (windows are open with
window.open
and render a subtree using React portals). But the styles from react-toastify are not injected in the other windows, making toasts only work in the main window.React-toastify should detect the current window containing the toast container (
element.ownerDocument.defaultView
) and inject the styles there if they haven’t been injected already in that window. Alternatively, expose aninjectStyles
function (with awindow_
argument) to make it possible to inject the styles in a different window.(already reported as #902 which was closed because it was supposed to be fixed in v11, but it isn’t)
The text was updated successfully, but these errors were encountered: