@radix-ui/react-use-callback-ref 1.1.0 → 1.1.1-rc.2

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 CHANGED
@@ -28,13 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // packages/react/use-callback-ref/src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  useCallbackRef: () => useCallbackRef
34
34
  });
35
- module.exports = __toCommonJS(src_exports);
35
+ module.exports = __toCommonJS(index_exports);
36
36
 
37
- // packages/react/use-callback-ref/src/useCallbackRef.tsx
37
+ // packages/react/use-callback-ref/src/use-callback-ref.tsx
38
38
  var React = __toESM(require("react"));
39
39
  function useCallbackRef(callback) {
40
40
  const callbackRef = React.useRef(callback);
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.ts", "../src/useCallbackRef.tsx"],
4
- "sourcesContent": ["export { useCallbackRef } from './useCallbackRef';\n", "import * 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 */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): 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\nexport { useCallbackRef };\n"],
3
+ "sources": ["../src/index.ts", "../src/use-callback-ref.tsx"],
4
+ "sourcesContent": ["export { useCallbackRef } from './use-callback-ref';\n", "import * 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 */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): 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\nexport { useCallbackRef };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,aAAO,QAAQ;AAEzC,EAAM,gBAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAa,cAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
6
6
  "names": []
7
7
  }
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // packages/react/use-callback-ref/src/useCallbackRef.tsx
1
+ // packages/react/use-callback-ref/src/use-callback-ref.tsx
2
2
  import * as React from "react";
3
3
  function useCallbackRef(callback) {
4
4
  const callbackRef = React.useRef(callback);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/useCallbackRef.tsx"],
3
+ "sources": ["../src/use-callback-ref.tsx"],
4
4
  "sourcesContent": ["import * 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 */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): 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\nexport { useCallbackRef };\n"],
5
5
  "mappings": ";AAAA,YAAY,WAAW;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,aAAO,QAAQ;AAEzC,EAAM,gBAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAa,cAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
6
6
  "names": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-use-callback-ref",
3
- "version": "1.1.0",
3
+ "version": "1.1.1-rc.2",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -24,9 +24,20 @@
24
24
  ],
25
25
  "sideEffects": false,
26
26
  "scripts": {
27
+ "lint": "eslint --max-warnings 0 src",
27
28
  "clean": "rm -rf dist",
28
29
  "version": "yarn version"
29
30
  },
31
+ "devDependencies": {
32
+ "@repo/eslint-config": "0.0.0",
33
+ "@repo/typescript-config": "0.0.0",
34
+ "@types/react": "^19.0.7",
35
+ "@types/react-dom": "^19.0.3",
36
+ "eslint": "^9.18.0",
37
+ "react": "^19.0.0",
38
+ "react-dom": "^19.0.0",
39
+ "typescript": "^5.7.3"
40
+ },
30
41
  "peerDependencies": {
31
42
  "@types/react": "*",
32
43
  "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
@@ -43,5 +54,6 @@
43
54
  },
44
55
  "bugs": {
45
56
  "url": "https://github.com/radix-ui/primitives/issues"
46
- }
57
+ },
58
+ "stableVersion": "1.1.0"
47
59
  }