Skip to content

Commit 211228a

Browse files
authored
Fix Lazy Load Image example (#304)
The latest version of the useNativeLatyLoading() Hook returns either 'false' or 'undefined', so the check needs to be changed to '!supportsLazyLoading' in order to work properly.
1 parent 61483fd commit 211228a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/Recipes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const LazyImage = ({ width, height, src, ...rest }) => {
4949

5050
return (
5151
<div
52-
ref={supportsLazyLoading === false ? ref : undefined}
52+
ref={!supportsLazyLoading ? ref : undefined}
5353
style={{
5454
position: 'relative',
5555
paddingBottom: `${(height / width) * 100}%`,

0 commit comments

Comments
 (0)