reshow-hooks
Advanced tools
Comparing version 0.17.12 to 0.17.13
@@ -13,7 +13,12 @@ "use strict"; | ||
var usePrevious = function usePrevious(value) { | ||
var prevValue = (0, _react.useRef)(); | ||
(0, _react.useEffect)(function () { | ||
prevValue.current = value; | ||
}, [value]); | ||
return prevValue.current; | ||
var data = (0, _react.useRef)({}); | ||
if (data.current.prev !== value) { | ||
data.current = { | ||
prev: data.current.cur, | ||
cur: value | ||
}; | ||
} | ||
return data.current.prev; | ||
}; | ||
@@ -20,0 +25,0 @@ |
{ | ||
"version": "0.17.12", | ||
"version": "0.17.13", | ||
"name": "reshow-hooks", | ||
@@ -4,0 +4,0 @@ "repository": { |
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
22561
610