Added loading=lazy to images

• Added:
- loading=lazy to images
This commit is contained in:
mgabdev
2020-08-17 16:28:04 -05:00
parent 7dadb125a2
commit bd20fd5ac5
3 changed files with 6 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ export default class Image extends React.PureComponent {
static propTypes = {
alt: PropTypes.string.isRequired,
src: PropTypes.string,
isLazy: PropTypes.string,
className: PropTypes.string,
width: PropTypes.oneOfType([
PropTypes.string,
@@ -44,7 +44,7 @@ export default class Image extends React.PureComponent {
fit,
className,
nullable,
lazy,
isLazy,
imageRef,
...otherProps
} = this.props
@@ -75,6 +75,7 @@ export default class Image extends React.PureComponent {
ref={imageRef}
src={src}
onError={this.handleOnError}
loading={isLazy ? 'lazy' : undefined}
/>
)
}