@tamagui/use-callback-ref 1.61.3 → 1.62.1

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/cjs/index.js CHANGED
@@ -1,20 +1,15 @@
1
- "use strict";
2
1
  var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
14
11
  for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
13
  return to;
19
14
  };
20
15
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
@@ -22,10 +17,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
17
  // file that has been converted to a CommonJS file using a Babel-
23
18
  // compatible transform (i.e. "__esModule" has not been set), then set
24
19
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
26
21
  mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
29
23
  var src_exports = {};
30
24
  __export(src_exports, {
31
25
  useCallbackRef: () => useCallbackRef
@@ -34,13 +28,9 @@ module.exports = __toCommonJS(src_exports);
34
28
  var React = __toESM(require("react"));
35
29
  function useCallbackRef(callback) {
36
30
  const callbackRef = React.useRef(callback);
37
- React.useEffect(() => {
31
+ return React.useEffect(() => {
38
32
  callbackRef.current = callback;
39
- });
40
- return React.useMemo(() => (...args) => {
41
- var _a;
42
- return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
43
- }, []);
33
+ }), React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
44
34
  }
45
35
  // Annotate the CommonJS export names for ESM import in node:
46
36
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAMhB,SAAS,eACd,UACG;AACH,QAAM,cAAc,MAAM,OAAO,QAAQ;AAEzC,QAAM,UAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAO,MAAM,QAAQ,MAAO,IAAI,SAAM;AAlBxC;AAkB2C,6BAAY,YAAZ,qCAAsB,GAAG;AAAA,KAAa,CAAC,CAAC;AACnF;",
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAMhB,SAAS,eACd,UACG;AACH,QAAM,cAAc,MAAM,OAAO,QAAQ;AAEzC,eAAM,UAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC,GAGM,MAAM,QAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: !0 });
10
+ }, __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from == "object" || typeof from == "function")
12
+ for (let key of __getOwnPropNames(from))
13
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
+ mod
23
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
+ var src_exports = {};
25
+ __export(src_exports, {
26
+ useCallbackRef: () => useCallbackRef
27
+ });
28
+ module.exports = __toCommonJS(src_exports);
29
+ var React = __toESM(require("react"));
30
+ function useCallbackRef(callback) {
31
+ const callbackRef = React.useRef(callback);
32
+ return React.useEffect(() => {
33
+ callbackRef.current = callback;
34
+ }), React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ useCallbackRef
39
+ });
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AAMhB,SAAS,eACd,UACG;AACH,QAAM,cAAc,MAAM,OAAO,QAAQ;AAEzC,eAAM,UAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC,GAGM,MAAM,QAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
5
+ "names": []
6
+ }
package/dist/esm/index.js CHANGED
@@ -1,13 +1,9 @@
1
1
  import * as React from "react";
2
2
  function useCallbackRef(callback) {
3
3
  const callbackRef = React.useRef(callback);
4
- React.useEffect(() => {
4
+ return React.useEffect(() => {
5
5
  callbackRef.current = callback;
6
- });
7
- return React.useMemo(() => (...args) => {
8
- var _a;
9
- return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
10
- }, []);
6
+ }), React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
11
7
  }
12
8
  export {
13
9
  useCallbackRef
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": "AAEA,YAAY,WAAW;AAMhB,SAAS,eACd,UACG;AACH,QAAM,cAAc,MAAM,OAAO,QAAQ;AAEzC,QAAM,UAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAO,MAAM,QAAQ,MAAO,IAAI,SAAM;AAlBxC;AAkB2C,6BAAY,YAAZ,qCAAsB,GAAG;AAAA,KAAa,CAAC,CAAC;AACnF;",
4
+ "mappings": "AAEA,YAAY,WAAW;AAMhB,SAAS,eACd,UACG;AACH,QAAM,cAAc,MAAM,OAAO,QAAQ;AAEzC,eAAM,UAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC,GAGM,MAAM,QAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
5
5
  "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-callback-ref",
3
- "version": "1.61.3",
3
+ "version": "1.62.1",
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.61.3"
21
+ "@tamagui/build": "1.62.1"
22
22
  },
23
23
  "exports": {
24
24
  "./package.json": "./package.json",