@tamagui/use-event
Advanced tools
Comparing version 1.0.1-beta.140 to 1.0.1-beta.141
@@ -6,10 +6,7 @@ import { useCallback, useEffect, useLayoutEffect, useRef } from "react"; | ||
function useGet(currentValue, initialValue, forwardToFunction) { | ||
const curRef = useRef(initialValue != null ? initialValue : currentValue); | ||
const curRef = useRef(initialValue ?? currentValue); | ||
useIsomorphicLayoutEffect(() => { | ||
curRef.current = currentValue; | ||
}); | ||
return useCallback(forwardToFunction ? (...args) => { | ||
var _a; | ||
return (_a = curRef.current) == null ? void 0 : _a.apply(null, args); | ||
} : () => curRef.current, []); | ||
return useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []); | ||
} | ||
@@ -16,0 +13,0 @@ export { |
{ | ||
"name": "@tamagui/use-event", | ||
"version": "1.0.1-beta.140", | ||
"version": "1.0.1-beta.141", | ||
"types": "./types/index.d.ts", | ||
@@ -22,3 +22,3 @@ "main": "dist/cjs", | ||
"devDependencies": { | ||
"@tamagui/build": "^1.0.1-beta.140", | ||
"@tamagui/build": "^1.0.1-beta.141", | ||
"react": "*" | ||
@@ -25,0 +25,0 @@ }, |
Sorry, the diff of this file is not supported yet
14153
194