react-visibility-sensor
Advanced tools
Comparing version 3.0.0 to 3.0.1
Changelog | ||
==== | ||
## 3.0.1 | ||
- return the new state from .check method | ||
## 3.0.0 | ||
@@ -5,0 +9,0 @@ |
{ | ||
"name": "react-visibility-sensor", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Sensor component for React that notifies you when it goes in or out of the window viewport.", | ||
@@ -5,0 +5,0 @@ "main": "visibility-sensor.js", |
@@ -117,12 +117,14 @@ 'use strict'; | ||
var state = this.state | ||
// notify the parent when the value changes | ||
if (this.state.isVisible !== isVisible) { | ||
this.setState({ | ||
state = { | ||
isVisible: isVisible, | ||
visibilityRect: visibilityRect | ||
}); | ||
}; | ||
this.setState(state); | ||
this.props.onChange(isVisible, visibilityRect); | ||
} | ||
return this.state; | ||
return state; | ||
}, | ||
@@ -129,0 +131,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18384
358