Skip to content

Commit b8330f8

Browse files
committed
Add more common errors
1 parent f04cfb7 commit b8330f8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ export default trackWindowScroll(Gallery);
252252

253253
## Common errors
254254

255+
### All images are being loaded at once
256+
257+
This package loads images when they are visible in the viewport. Before an image is loaded, it occupies 0x0 pixels, so if you have a gallery of images, that means all images will be in the visible part of the page until the first ones load and start pushing down the other ones.
258+
259+
To fix this issue, make sure you either set a `height` and `width` props or a `placeholder` to your images.
260+
261+
### Effects are not working
262+
263+
You need to import the effect CSS as shown in the [Using effects](#using-effects) code example.
264+
265+
Also, notice browsers might behave differently while images are loading. Some times, while an image is not completely loaded yet, the browser will show a white background behind it, making the effect not to be visible. This is an issue with browsers and not something that can be fixed in this package.
266+
255267
### Warning: setState(...): Can only update a mounted or mounting component.
256268

257269
That warning might appear if there are two components using `trackWindowScroll` at the same time. Notice it's not possible to have a LazyLoadImage/LazyLoadComponent inside another LazyLoadComponent for now. Also, make sure you are passing down `scrollPosition` to all components wrapped inside `trackWindowScroll`.

0 commit comments

Comments
 (0)