react-waypoint
Advanced tools
Comparing version 9.0.1 to 9.0.2
@@ -0,1 +1,5 @@ | ||
## 9.0.2 | ||
- Remove StrictMode warnings | ||
## 9.0.1 | ||
@@ -2,0 +6,0 @@ |
@@ -162,21 +162,3 @@ 'use strict'; | ||
var errorMessage = '<Waypoint> expected to receive a single React element child.\n\n' + 'See https://goo.gl/LrBNgw for more info.'; | ||
/** | ||
* Raise an error if more that one child was provided to "children" | ||
* | ||
* @param {?React.element} children | ||
* @return {undefined} | ||
*/ | ||
function ensureChildrenIsValid(children) { | ||
if (children) { | ||
try { | ||
React.Children.only(children); | ||
} catch (e) { | ||
throw new Error(errorMessage); | ||
} | ||
} | ||
} | ||
/** | ||
* When an element's type is a string, it represents a DOM node with that tag name | ||
@@ -192,3 +174,3 @@ * https://facebook.github.io/react/blog/2015/12/18/react-components-elements-and-instances.html#dom-elements | ||
var errorMessage$1 = '<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a ' + 'DOM element (e.g. <div>) nor does it use the innerRef prop.\n\n' + 'See https://goo.gl/LrBNgw for more info.'; | ||
var errorMessage = '<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a ' + 'DOM element (e.g. <div>) nor does it use the innerRef prop.\n\n' + 'See https://goo.gl/LrBNgw for more info.'; | ||
/** | ||
@@ -204,3 +186,3 @@ * Raise an error if "children" is not a DOM Element and there is no ref provided to Waypoint | ||
if (children && !isDOMElement(children) && !ref) { | ||
throw new Error(errorMessage$1); | ||
throw new Error(errorMessage); | ||
} | ||
@@ -331,11 +313,2 @@ } | ||
_createClass(Waypoint, [{ | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
var children = this.props.children; | ||
if (process.env.NODE_ENV !== 'production') { | ||
ensureChildrenIsValid(children); | ||
} | ||
} | ||
}, { | ||
key: "componentDidMount", | ||
@@ -377,9 +350,2 @@ value: function componentDidMount() { | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(newProps) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
ensureChildrenIsValid(newProps.children); | ||
} | ||
} | ||
}, { | ||
key: "componentDidUpdate", | ||
@@ -386,0 +352,0 @@ value: function componentDidUpdate() { |
@@ -156,21 +156,3 @@ import { addEventListener } from 'consolidated-events'; | ||
var errorMessage = '<Waypoint> expected to receive a single React element child.\n\n' + 'See https://goo.gl/LrBNgw for more info.'; | ||
/** | ||
* Raise an error if more that one child was provided to "children" | ||
* | ||
* @param {?React.element} children | ||
* @return {undefined} | ||
*/ | ||
function ensureChildrenIsValid(children) { | ||
if (children) { | ||
try { | ||
React.Children.only(children); | ||
} catch (e) { | ||
throw new Error(errorMessage); | ||
} | ||
} | ||
} | ||
/** | ||
* When an element's type is a string, it represents a DOM node with that tag name | ||
@@ -186,3 +168,3 @@ * https://facebook.github.io/react/blog/2015/12/18/react-components-elements-and-instances.html#dom-elements | ||
var errorMessage$1 = '<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a ' + 'DOM element (e.g. <div>) nor does it use the innerRef prop.\n\n' + 'See https://goo.gl/LrBNgw for more info.'; | ||
var errorMessage = '<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a ' + 'DOM element (e.g. <div>) nor does it use the innerRef prop.\n\n' + 'See https://goo.gl/LrBNgw for more info.'; | ||
/** | ||
@@ -198,3 +180,3 @@ * Raise an error if "children" is not a DOM Element and there is no ref provided to Waypoint | ||
if (children && !isDOMElement(children) && !ref) { | ||
throw new Error(errorMessage$1); | ||
throw new Error(errorMessage); | ||
} | ||
@@ -325,11 +307,2 @@ } | ||
_createClass(Waypoint, [{ | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
var children = this.props.children; | ||
if (process.env.NODE_ENV !== 'production') { | ||
ensureChildrenIsValid(children); | ||
} | ||
} | ||
}, { | ||
key: "componentDidMount", | ||
@@ -371,9 +344,2 @@ value: function componentDidMount() { | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(newProps) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
ensureChildrenIsValid(newProps.children); | ||
} | ||
} | ||
}, { | ||
key: "componentDidUpdate", | ||
@@ -380,0 +346,0 @@ value: function componentDidUpdate() { |
{ | ||
"name": "react-waypoint", | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"description": "A React component to execute a function whenever you scroll to an element.", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.js", |
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
10
69349
1159