fkhadra / fkhadra/react-toastify
No styles in toasts in additional windows (v11)
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 741
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
Assessment
This issue has not been assessed yet.