@tamagui/use-callback-ref 1.124.17 → 1.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/types/index.d.ts +4 -3
- package/types/index.d.ts.map +13 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-callback-ref",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.125.0",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tamagui/build": "1.
|
|
21
|
+
"@tamagui/build": "1.125.0"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
3
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
4
|
+
*/
|
|
5
5
|
export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
|
|
6
|
+
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"mappings": ";;;;AAQA,OAAO,iBAAS,eAAe,WAAW,GAAG,qBAC3CA,UAAU,gBACT",
|
|
3
|
+
"names": [
|
|
4
|
+
"callback: T | undefined"
|
|
5
|
+
],
|
|
6
|
+
"sources": [
|
|
7
|
+
"src/index.ts"
|
|
8
|
+
],
|
|
9
|
+
"sourcesContent": [
|
|
10
|
+
"// via radix-ui\n\nimport * as React from 'react'\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nexport function useCallbackRef<T extends (...args: any[]) => any>(\n callback: T | undefined\n): T {\n const callbackRef = React.useRef(callback)\n\n React.useEffect(() => {\n callbackRef.current = callback\n })\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, [])\n}\n"
|
|
11
|
+
],
|
|
12
|
+
"version": 3
|
|
13
|
+
}
|