react-peekaboo
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -30,3 +30,3 @@ import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck'; | ||
onChange = _ref.onChange; | ||
var rootMargin = "".concat(offsetTop, "px 0px ").concat(offsetBottom, "px 0px"); | ||
var rootMargin = "".concat(offsetBottom, "px 0px ").concat(offsetTop, "px 0px"); | ||
var observer = new IntersectionObserver(function (_ref2) { | ||
@@ -146,3 +146,3 @@ var _ref3 = _slicedToArray(_ref2, 1), | ||
value: function componentDidUpdate(prevProps, prevState) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetTop || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevState.element !== this.state.element) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetBottom || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevState.element !== this.state.element) { | ||
this.safeTeardown(); | ||
@@ -222,3 +222,3 @@ this.setup(); | ||
value: function componentDidUpdate(prevProps, prevState) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetTop || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevProps.throttle !== this.props.throttle || prevState.element !== this.state.element) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetBottom || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevProps.throttle !== this.props.throttle || prevState.element !== this.state.element) { | ||
this.safeTeardown(); | ||
@@ -225,0 +225,0 @@ this.setup(); |
@@ -36,3 +36,3 @@ 'use strict'; | ||
onChange = _ref.onChange; | ||
var rootMargin = "".concat(offsetTop, "px 0px ").concat(offsetBottom, "px 0px"); | ||
var rootMargin = "".concat(offsetBottom, "px 0px ").concat(offsetTop, "px 0px"); | ||
var observer = new IntersectionObserver(function (_ref2) { | ||
@@ -152,3 +152,3 @@ var _ref3 = _slicedToArray(_ref2, 1), | ||
value: function componentDidUpdate(prevProps, prevState) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetTop || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevState.element !== this.state.element) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetBottom || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevState.element !== this.state.element) { | ||
this.safeTeardown(); | ||
@@ -228,3 +228,3 @@ this.setup(); | ||
value: function componentDidUpdate(prevProps, prevState) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetTop || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevProps.throttle !== this.props.throttle || prevState.element !== this.state.element) { | ||
if (prevProps.children !== this.props.children || prevProps.enabled !== this.props.enabled || prevProps.offsetBottom !== this.props.offsetBottom || prevProps.offsetTop !== this.props.offsetTop || prevProps.onChange !== this.props.onChange || prevProps.throttle !== this.props.throttle || prevState.element !== this.state.element) { | ||
this.safeTeardown(); | ||
@@ -231,0 +231,0 @@ this.setup(); |
{ | ||
"name": "react-peekaboo", | ||
"description": "React component that notifies when its child enters or exits the viewport", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": "Wyatt Johnston <w@wyatt.page>", |
@@ -52,2 +52,8 @@ # `react-peekaboo` | ||
##### `enabled: boolean` | ||
Enables/disables running the viewport-check side effect. | ||
Default: `true` | ||
##### `offsetBottom?: number` | ||
@@ -88,2 +94,8 @@ | ||
##### `enabled: boolean` | ||
Enables/disables running the viewport-check side effect. | ||
Default: `true` | ||
##### `offsetBottom?: number` | ||
@@ -115,2 +127,8 @@ | ||
##### `enabled: boolean` | ||
Enables/disables running the viewport-check side effect. | ||
Default: `true` | ||
##### `offsetBottom?: number` | ||
@@ -117,0 +135,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
25255
166