reshow-hooks
Advanced tools
Comparing version 0.17.20 to 0.17.21
@@ -17,18 +17,12 @@ "use strict"; | ||
/** | ||
* @typedef {object} IntersectionObserverProps | ||
* @property {React.ReactElement|string} component | ||
* @property {IntersectionObserverCallback} onIntersect | ||
* @property {object} [options=null] | ||
* @param {React.ReactElement|string} component | ||
* @param {IntersectionObserverCallback} onIntersect | ||
* @param {object} options | ||
* @returns {React.ReactElement} | ||
*/ | ||
var useIntersectionObserver = function useIntersectionObserver(component, onIntersect, options) { | ||
if (options === void 0) { | ||
options = {}; | ||
} | ||
/** | ||
* @param {IntersectionObserverProps} param | ||
*/ | ||
var useIntersectionObserver = function useIntersectionObserver(_ref) { | ||
var component = _ref.component, | ||
onIntersect = _ref.onIntersect, | ||
_ref$options = _ref.options, | ||
options = _ref$options === void 0 ? { | ||
threshold: [0, 1] | ||
} : _ref$options; | ||
var lastEl = (0, _react.useRef)(); | ||
@@ -35,0 +29,0 @@ var el = (0, _reshowBuild["default"])(component)({ |
{ | ||
"version": "0.17.20", | ||
"version": "0.17.21", | ||
"name": "reshow-hooks", | ||
@@ -4,0 +4,0 @@ "repository": { |
export default useIntersectionObserver; | ||
export type IntersectionObserverProps = { | ||
component: React.ReactElement | string; | ||
onIntersect: IntersectionObserverCallback; | ||
options?: object; | ||
}; | ||
/** | ||
* @typedef {object} IntersectionObserverProps | ||
* @property {React.ReactElement|string} component | ||
* @property {IntersectionObserverCallback} onIntersect | ||
* @property {object} [options=null] | ||
* @param {React.ReactElement|string} component | ||
* @param {IntersectionObserverCallback} onIntersect | ||
* @param {object} options | ||
* @returns {React.ReactElement} | ||
*/ | ||
/** | ||
* @param {IntersectionObserverProps} param | ||
*/ | ||
declare function useIntersectionObserver({ component, onIntersect, options, }: IntersectionObserverProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>; | ||
declare function useIntersectionObserver(component: React.ReactElement | string, onIntersect: IntersectionObserverCallback, options?: object): React.ReactElement; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
28113
789