DEV Community

Discussion on: Fixing lazyload images with React Server-Side Render

Collapse
 
dalbir profile image
Dalvir • Edited

How I can use this in My React Application, example please. And also please correct the type in lazyImages

Collapse
 
hieussr profile image
Hieu Nguyen

To use the function, you will need to call lazyImages as following:

lazyImages();

// offset before the image is scrolled into view
lazyImages({ rootMargin: "100px" });
Enter fullscreen mode Exit fullscreen mode

Thanks for mentioning, I've added this to the post.

Besides, what type was incorrect?