I’m trying to load a placeholder image gracefully when the original image path/url is undefined or null. I have a onError method that handles events of this type however the onError method I am using particularly takes in an HTMLImageElement . I would like the placeholder image to be of a SVG (imported from a S3 bucket and stored, then called to the application). How can I display an SVG element when my original image path is null or undefined?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/KjX7o82
I have written a sample code ( Github Link here ). this is a simple next js app, but giving me error when I refresh the page. This seems to be the common problem and I tried the fix provided in the internet but does not seem to fix my issue. The error is Warning: Prop className did not match. Server: "MuiBox-root MuiBox-root-1" Client: "MuiBox-root MuiBox-root-2". Did changes for _document.js, modified _app.js as mentioned in official website and solutions in stackoverflow. but nothing seems to work. Could someone take a look and help me whats wrong with the code? Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment