@radix-ui/react-use-callback-ref 1.1.5-rc.1791763750187 → 1.1.6
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/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/use-callback-ref.tsx"],
|
|
4
|
-
"sourcesContent": ["export { useCallbackRef } from './use-callback-ref';\n", "/* eslint-disable react-hooks/rules-of-hooks */\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport * as React from 'react';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// See https://github.com/webpack/webpack/issues/14814\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering\n * re-renders when passed as a prop or avoid re-executing effects when passed as\n * a dependency.\n */\nexport function useCallbackRef<T extends AnyFunction>(callback: T | undefined): T {\n const callbackRef = React.useRef<AnyFunction | undefined>(callback);\n\n // See https://github.com/webpack/webpack/issues/14814\n if (typeof useReactInsertionEffect === 'function') {\n useReactInsertionEffect(() => {\n callbackRef.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n callbackRef.current = callback;\n });\n }\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n"],
|
|
4
|
+
"sourcesContent": ["export { useCallbackRef } from './use-callback-ref.js';\n", "/* eslint-disable react-hooks/rules-of-hooks */\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport * as React from 'react';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// See https://github.com/webpack/webpack/issues/14814\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering\n * re-renders when passed as a prop or avoid re-executing effects when passed as\n * a dependency.\n */\nexport function useCallbackRef<T extends AnyFunction>(callback: T | undefined): T {\n const callbackRef = React.useRef<AnyFunction | undefined>(callback);\n\n // See https://github.com/webpack/webpack/issues/14814\n if (typeof useReactInsertionEffect === 'function') {\n useReactInsertionEffect(() => {\n callbackRef.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n callbackRef.current = callback;\n });\n }\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,qCAAgC;AAChC,YAAuB;AAKvB,IAAM,0BAA2B,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC;AAOhF,SAAS,eAAsC,UAA4B;AAChF,QAAM,cAAoB,aAAgC,QAAQ;AAGlE,MAAI,OAAO,4BAA4B,YAAY;AACjD,4BAAwB,MAAM;AAC5B,kBAAY,UAAU;AAAA,IACxB,CAAC;AAAA,EACH,OAAO;AACL,wDAAgB,MAAM;AACpB,kBAAY,UAAU;AAAA,IACxB,CAAC;AAAA,EACH;AAGA,SAAa,cAAQ,OAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,IAAS,CAAC,CAAC;AACnF;AAhBgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-use-callback-ref",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": false,
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@radix-ui/react-use-layout-effect": "1.1.
|
|
14
|
+
"@radix-ui/react-use-layout-effect": "1.1.5"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/react": "^19.3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"lint": "oxlint --max-warnings 0 src",
|
|
45
45
|
"clean": "rm -rf dist",
|
|
46
46
|
"reset": "rm -rf dist node_modules",
|
|
47
|
-
"
|
|
47
|
+
"types:check:pkg": "tsc --noEmit",
|
|
48
48
|
"build": "radix-build"
|
|
49
49
|
},
|
|
50
50
|
"types": "./dist/index.d.ts",
|