react-stick
Advanced tools
Comparing version 4.1.1 to 4.1.2
import { useEffect } from 'react'; | ||
function useWatcher(watcher, _ref) { | ||
var updateOnAnimationFrame = _ref.updateOnAnimationFrame; | ||
var updateOnAnimationFrame = _ref.updateOnAnimationFrame, | ||
enabled = _ref.enabled; | ||
useEffect(function () { | ||
@@ -9,3 +10,3 @@ var animationFrameId; | ||
if (typeof window.requestAnimationFrame !== 'undefined') { | ||
if (enabled && typeof window.requestAnimationFrame !== 'undefined') { | ||
var callback = function callback() { | ||
@@ -33,5 +34,5 @@ watcher(); | ||
}; | ||
}, [updateOnAnimationFrame, watcher]); | ||
}, [updateOnAnimationFrame, watcher, enabled]); | ||
} | ||
export default useWatcher; |
@@ -121,3 +121,4 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
useWatcher(measure, { | ||
updateOnAnimationFrame: updateOnAnimationFrame | ||
updateOnAnimationFrame: updateOnAnimationFrame, | ||
enabled: !!node | ||
}); | ||
@@ -124,0 +125,0 @@ var handleReposition = useCallback(function () { |
@@ -77,3 +77,4 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
useWatcher(measure, { | ||
updateOnAnimationFrame: updateOnAnimationFrame | ||
updateOnAnimationFrame: updateOnAnimationFrame, | ||
enabled: visible | ||
}); | ||
@@ -80,0 +81,0 @@ var Component = component || 'div'; |
@@ -9,3 +9,4 @@ "use strict"; | ||
function useWatcher(watcher, _ref) { | ||
var updateOnAnimationFrame = _ref.updateOnAnimationFrame; | ||
var updateOnAnimationFrame = _ref.updateOnAnimationFrame, | ||
enabled = _ref.enabled; | ||
(0, _react.useEffect)(function () { | ||
@@ -15,3 +16,3 @@ var animationFrameId; | ||
if (typeof window.requestAnimationFrame !== 'undefined') { | ||
if (enabled && typeof window.requestAnimationFrame !== 'undefined') { | ||
var callback = function callback() { | ||
@@ -39,3 +40,3 @@ watcher(); | ||
}; | ||
}, [updateOnAnimationFrame, watcher]); | ||
}, [updateOnAnimationFrame, watcher, enabled]); | ||
} | ||
@@ -42,0 +43,0 @@ |
@@ -143,3 +143,4 @@ "use strict"; | ||
(0, _hooks.useWatcher)(measure, { | ||
updateOnAnimationFrame: updateOnAnimationFrame | ||
updateOnAnimationFrame: updateOnAnimationFrame, | ||
enabled: !!node | ||
}); | ||
@@ -146,0 +147,0 @@ var handleReposition = (0, _react.useCallback)(function () { |
@@ -93,3 +93,4 @@ "use strict"; | ||
(0, _hooks.useWatcher)(measure, { | ||
updateOnAnimationFrame: updateOnAnimationFrame | ||
updateOnAnimationFrame: updateOnAnimationFrame, | ||
enabled: visible | ||
}); | ||
@@ -96,0 +97,0 @@ var Component = component || 'div'; |
{ | ||
"name": "react-stick", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "React component to stick a portaled node to an anchor node", | ||
@@ -38,3 +38,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@babel/core": "7.12.1", | ||
"@babel/core": "7.12.3", | ||
"@babel/plugin-proposal-object-rest-spread": "7.12.1", | ||
@@ -44,4 +44,4 @@ "@babel/plugin-transform-runtime": "7.12.1", | ||
"@babel/preset-flow": "7.12.1", | ||
"@babel/preset-react": "7.12.1", | ||
"@testing-library/react": "11.1.0", | ||
"@babel/preset-react": "7.12.5", | ||
"@testing-library/react": "11.1.1", | ||
"babel-eslint": "10.1.0", | ||
@@ -52,9 +52,9 @@ "babel-loader": "8.1.0", | ||
"core-js": "3.6.5", | ||
"eslint": "7.11.0", | ||
"eslint-config-react-app": "5.2.1", | ||
"eslint": "7.12.1", | ||
"eslint-config-react-app": "6.0.0", | ||
"eslint-plugin-flowtype": "5.2.0", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-jsx-a11y": "6.3.1", | ||
"eslint-plugin-react": "7.21.4", | ||
"eslint-plugin-react-hooks": "4.1.2", | ||
"eslint-plugin-jsx-a11y": "6.4.1", | ||
"eslint-plugin-react": "7.21.5", | ||
"eslint-plugin-react-hooks": "4.2.0", | ||
"flow-bin": "0.133.0", | ||
@@ -65,3 +65,3 @@ "flow-copy-source": "2.0.9", | ||
"html-webpack-plugin": "4.5.0", | ||
"inferno": "7.4.5", | ||
"inferno": "7.4.6", | ||
"nwb": "0.25.2", | ||
@@ -72,3 +72,3 @@ "prettier": "2.1.2", | ||
"regenerator-runtime": "0.13.7", | ||
"semantic-release": "17.2.1", | ||
"semantic-release": "17.2.2", | ||
"substyle-glamor": "4.1.0", | ||
@@ -75,0 +75,0 @@ "webpack": "4.44.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
130630
1645