New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-lazyload

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lazyload - npm Package Compare versions

Comparing version

to
1.3.2

8

lib/index.js

@@ -206,2 +206,10 @@ /**

LazyLoad.prototype.render = function render() {
/**
* For components like images, they shouldn't be rendered until it appears
* in the viewport.
*/
if (this.props.once && !this.state.visible) {
return null;
}
return _react2['default'].cloneElement(this.props.children, {

@@ -208,0 +216,0 @@ visible: this.state.visible,

2

package.json
{
"name": "react-lazyload",
"version": "1.3.1",
"version": "1.3.2",
"description": "Lazyload your Component, Image or anything matters the performance.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -7,2 +7,4 @@ # react-lazyload [![npm version](https://badge.fury.io/js/react-lazyload.svg)](http://badge.fury.io/js/react-lazyload)

> 2.0.0-beta is out, try it out [here](https://github.com/jasonslyvia/react-lazyload/tree/2.0.0-beta2)
## Why it's better

@@ -9,0 +11,0 @@

@@ -191,2 +191,10 @@ /**

render() {
/**
* For components like images, they shouldn't be rendered until it appears
* in the viewport.
*/
if (this.props.once && !this.state.visible) {
return null;
}
return React.cloneElement(this.props.children, {

@@ -193,0 +201,0 @@ visible: this.state.visible,