Skip to content

Commit 9e837c0

Browse files
AndriiuxaAljullu
authored andcommitted
Bug fix (#51)
* adjsut turnary * make nested turnary more readable * this is what happens when you edit directly inside github..
1 parent 163ac60 commit 9e837c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/LazyLoadImage.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class LazyLoadImage extends React.Component {
7373
className={wrapperClassName + ' lazy-load-image-background ' +
7474
effect + loadedClassName}
7575
style={{
76-
backgroundImage: loaded ? '' : 'url( ' + placeholderSrc + ')',
77-
backgroundSize: loaded ? '' : '100% 100%',
76+
backgroundImage: loaded || !placeholderSrc ? '' : `url(${placeholderSrc})`,
77+
backgroundSize: loaded || !placeholderSrc ? '' : '100% 100%',
7878
color: 'transparent',
7979
display: 'inline-block',
8080
height: height,
@@ -120,7 +120,7 @@ LazyLoadImage.defaultProps = {
120120
delayMethod: 'throttle',
121121
delayTime: 300,
122122
effect: '',
123-
placeholderSrc: '',
123+
placeholderSrc: null,
124124
threshold: 100,
125125
useIntersectionObserver: true,
126126
visibleByDefault: false,

0 commit comments

Comments
 (0)