react-lazyload
react-lazyload copied to clipboard
Add compatibility with react-snapshot
I added react-lazyload (I'm impressed by the ease of use!) and have tried it out on my site. Since I'm client-rendering, I use react-snapshot to generate html-only versions of my site. Unfortunately, the images don't appear in the snapshot pages.
Is there a way to add compatibility for this use-case? Such as disabling the laziness when snapshotting?
Thanks!
@LinusGeffarth I think you can do that through environment variables supported by react and use it to turn on or off the lazy loading
Thanks. But how world I turn it off at run time?
@LinusGeffarth you can set the forceVisible prop which will kind of turn lazy loading off
How would I do that? I don't have an extra component for images at the moment. I just do:
<LazyLoad>
<img src="" />
</LazyLoad>
So how do I do that?
https://github.com/twobin/react-lazyload#forcevisible check the above link, you can call forceVisible method