-
Notifications
You must be signed in to change notification settings - Fork 110
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
Cannot view images inside popup #104
Comments
please add support for images |
@ZakiMohammad Figured out how to add support for images using react-new-window. Looks like the library cannot load images from project sources because by default the url Prop is set to about:blank. A work around I did was to create a component that has the image content and then using react-router-dom create a route pointing to the component. For example
Then override the default NewWindow url prop with the url of the route. This lets the newwindow component render the images and any other components. |
An alternative solution that doesn't require changing all the relative urls in your code is to set the <NewWindow
onOpen={(window) => {
const baseEl = window.document.createElement("base");
baseEl.setAttribute("href", "http://localhost:3000/");
window.document.head.prepend(baseEl);
}}
>
...
</NewWindow> |
No description provided.
The text was updated successfully, but these errors were encountered: