ApoorvSaxena/lozad.js

Lozad doesn`t replace src with data-src

mehdy-karimpour opened this issue · 0 comments

Hi,

I am using Lozad in my React Typescript project. I put the following code

const observer = lozad(".lozad", {
    loaded: (el: any) => {
      el.classList.add("lozad-fade");
    }
  });

React.useEffect(() => {
    observer.observe();
  }, [observer.observe]);

When new images are in same view or sometimes in page routings, the Lozad does not replace src with data-src attribute and the result is seeing the low quality images not normal ones, but actually when I inspected the elements, all images have lozad-fade class. It is strange for me!

Would you please help me?