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 using this with multiple source components, like the "Responsive images" example in the readme, and i get an error. your example in the readme actually works
i get the error at
image.src = loadingImage.src || loadingImage.srcSet;
TypeError: Cannot read property 'src' of undefined
i haven't figured out everything yet, but i think the problem is, ironically, because of the mysteries of the children prop, defaultImage becomes an array of the 3 source elements, and sourceImages becomes and empty array.
makes everything work for me, but i'm not sure what the best solution is.
Perhaps a sidenote, but this (putting both the individual source elements and the map) actually seems to work. I don't know why, because defaultImage seems to be the same array in either case.
i'm using this with multiple source components, like the "Responsive images" example in the readme, and i get an error. your example in the readme actually works
but creating source elements by mapping an array does not.
i get the error at
image.src = loadingImage.src || loadingImage.srcSet;
TypeError: Cannot read property 'src' of undefined
i haven't figured out everything yet, but i think the problem is, ironically, because of the mysteries of the children prop, defaultImage becomes an array of the 3
source
elements, and sourceImages becomes and empty array.adding
after
makes everything work for me, but i'm not sure what the best solution is.
Perhaps a sidenote, but this (putting both the individual source elements and the map) actually seems to work. I don't know why, because defaultImage seems to be the same array in either case.
Too tired to figure it out unless necessary, but it probably has something to do with this line,
Anyway, it seems a straightforward fix, but i haven't given it careful thought or any sort of testing. thanks for the library.
The text was updated successfully, but these errors were encountered: