You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ export default MyImage;
77
77
| useIntersectionObserver |`Boolean`| true | Whether to use browser's IntersectionObserver when available. |
78
78
| visibleByDefault |`Boolean`| false | Whether the image must be visible from the beginning. |
79
79
| wrapperClassName |`String`|| In some occasions (for example, when using a placeholderSrc) a wrapper span tag is rendered. This prop allows setting a class to that element. |
80
+
| wrapperProps |`Object`| null | Props that should be passed to the wrapper span when it is rendered (for example, when using placeholderSrc or effect) |
80
81
| ... ||| Any other image attribute |
81
82
82
83
@@ -146,7 +147,6 @@ export default Article;
146
147
| useIntersectionObserver |`Boolean`| true | Whether to use browser's IntersectionObserver when available. |
147
148
| visibleByDefault |`Boolean`| false | Whether the component must be visible from the beginning. |
148
149
149
-
150
150
## Using `trackWindowScroll` HOC to improve performance
151
151
152
152
When you have many elements to lazy load in the same page, you might get poor performance because each one is listening to the scroll/resize events. In that case, it's better to wrap the deepest common parent of those components with a HOC to track those events (`trackWindowScroll`).
@@ -193,6 +193,7 @@ You must set the prop `scrollPosition` to the lazy load components. This way, th
193
193
| placeholder |`ReactClass`|`<span>`| React element to use as a placeholder. |
194
194
| threshold |`Number`| 100 | Threshold in pixels. So the image starts loading before it appears in the viewport. |
195
195
| visibleByDefault |`Boolean`| false | Whether the image must be visible from the beginning. |
196
+
| wrapperProps |`Object`| null | Props that should be passed to the wrapper span when it is rendered (for example, when using placeholderSrc or effect) |
196
197
| ... ||| Any other image attribute |
197
198
198
199
Component wrapped with `trackWindowScroll` (in the example, `Gallery`)
0 commit comments