SCSS for .image-container
.image-container{
position: relative;
.loader{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
&.hidden {
display: none;
}
}
}
Uses of the Image component
<Image src={data.image} />
The following happens when you use the Image component instead of the img
tag.
inview
method as a callback..image-container
.image-container
is in-view it sets the state with loaded property to trueLazy loading can make the app load fast and provide a better user experience.
Google Develover Expert — WebTechnologies and Angular | Principal Architect at Naukri.com | Entrepreneur | TechEnthusiast | Speaker