@restart/hooks
Advanced tools
Comparing version 0.3.13 to 0.3.14
@@ -18,3 +18,3 @@ export interface UseAnimationFrameReturn { | ||
* | ||
* ```tsx | ||
* ```ts | ||
* const [style, setStyle] = useState({}); | ||
@@ -21,0 +21,0 @@ * const animationFrame = useAnimationFrame(); |
@@ -8,4 +8,2 @@ "use strict"; | ||
var _useWillUnmount = _interopRequireDefault(require("./useWillUnmount")); | ||
var _useMounted = _interopRequireDefault(require("./useMounted")); | ||
@@ -15,2 +13,4 @@ | ||
var _useWillUnmount = _interopRequireDefault(require("./useWillUnmount")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -22,3 +22,3 @@ | ||
* | ||
* ```tsx | ||
* ```ts | ||
* const [style, setStyle] = useState({}); | ||
@@ -25,0 +25,0 @@ * const animationFrame = useAnimationFrame(); |
@@ -30,3 +30,3 @@ "use strict"; | ||
var updater = function updater(update) { | ||
var updater = (0, _react.useCallback)(function (update) { | ||
if (update === null) return; | ||
@@ -44,5 +44,4 @@ | ||
} | ||
}; | ||
}, [setState]); | ||
return [state, updater]; | ||
} |
@@ -18,3 +18,3 @@ export interface UseAnimationFrameReturn { | ||
* | ||
* ```tsx | ||
* ```ts | ||
* const [style, setStyle] = useState({}); | ||
@@ -21,0 +21,0 @@ * const animationFrame = useAnimationFrame(); |
import { useRef } from 'react'; | ||
import useWillUnmount from './useWillUnmount'; | ||
import useMounted from './useMounted'; | ||
import useStableMemo from './useStableMemo'; | ||
import useWillUnmount from './useWillUnmount'; | ||
@@ -10,3 +10,3 @@ /** | ||
* | ||
* ```tsx | ||
* ```ts | ||
* const [style, setStyle] = useState({}); | ||
@@ -13,0 +13,0 @@ * const animationFrame = useAnimationFrame(); |
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import { useState } from 'react'; | ||
import { useCallback, useState } from 'react'; | ||
@@ -25,3 +25,3 @@ /** | ||
var updater = function updater(update) { | ||
var updater = useCallback(function (update) { | ||
if (update === null) return; | ||
@@ -39,5 +39,4 @@ | ||
} | ||
}; | ||
}, [setState]); | ||
return [state, updater]; | ||
} |
{ | ||
"name": "@restart/hooks", | ||
"version": "0.3.13", | ||
"version": "0.3.14", | ||
"main": "cjs/index.js", | ||
@@ -18,3 +18,3 @@ "types": "cjs/index.d.ts", | ||
"preset": "@4c", | ||
"setupFiles": [ | ||
"setupFilesAfterEnv": [ | ||
"./test/setup.js" | ||
@@ -43,3 +43,3 @@ ] | ||
"homepage": "https://github.com/jquense/react-common-hooks#readme", | ||
"_id": "@restart/hooks@0.3.12" | ||
"_id": "@restart/hooks@0.3.13" | ||
} |
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
126274
149
3352