use-latest-callback
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -21,5 +21,8 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var React = __importStar(require("react")); | ||
var useIsomorphicLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect; | ||
var useIsomorphicLayoutEffect_1 = __importDefault(require("./useIsomorphicLayoutEffect")); | ||
/** | ||
@@ -38,3 +41,3 @@ * React hook which returns the latest callback without changing the reference. | ||
}).current; | ||
useIsomorphicLayoutEffect(function () { | ||
useIsomorphicLayoutEffect_1.default(function () { | ||
ref.current = callback; | ||
@@ -41,0 +44,0 @@ }); |
{ | ||
"name": "use-latest-callback", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "React hook which returns the latest callback without changing the reference", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
import * as React from 'react'; | ||
import useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect'; | ||
const useIsomorphicLayoutEffect = | ||
typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect; | ||
/** | ||
@@ -7,0 +5,0 @@ * React hook which returns the latest callback without changing the reference. |
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
6046
11
97
13
0
0
0
4