Background image not rendereing from props
alluster opened this issue · 4 comments
It looks like that the opacity is not switched from 0
to 1
. This happens if the image is not loaded or the hero component is not in the viewport. Are there any errors in the browser console?
There were warnings about the imageSrc={} supposed to be a string value in initial state in the parent component, which in my case was actually a boolean but changing this did not help. Also changed the opacity from string to a number due some warnings. Now when I console.log(heroImage) in the child component Hero.js right before it's supposed to throw it to the imageSrc={}, console shows that it renders empty few times. This is due my parent component gets the image from source later than the hero actually renders maybe? I'm not sure how to fix this..
Can you test it with the newest version (react-lazy-hero@0.4.0)?
Great thanks, works like a charm now!