one 1.1.454 → 1.1.456

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.
@@ -35,5 +35,5 @@ function Redirect({
35
35
  } catch (error) {
36
36
  console.error(error);
37
37
  }
38
- }), null;
38
+ }, [href]), null;
39
39
  }
@@ -26,6 +26,6 @@ function Redirect({ href }) {
26
26
  } catch (error) {
27
27
  console.error(error);
28
28
  }
29
- }), null;
29
+ }, [href]), null;
30
30
  }
31
31
  //# sourceMappingURL=Redirect.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/link/Redirect.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B,qBAE1B,wBAA+B;AAGxB,SAAS,SAAS,EAAE,KAAK,GAA6B;AAC3D,QAAM,aAAS,wBAAU;AACzB,mDAAe,MAAM;AACnB,QAAI;AACF,aAAO,QAAQ,IAAI;AAAA,IACrB,SAAS,OAAO;AACd,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF,CAAC,GACM;AACT;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B,qBAE1B,wBAA+B;AAIxB,SAAS,SAAS,EAAE,KAAK,GAA6B;AAC3D,QAAM,aAAS,wBAAU;AAEzB,mDAAe,MAAM;AACnB,QAAI;AACF,aAAO,QAAQ,IAAI;AAAA,IACrB,SAAS,OAAO;AACd,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,IAAI,CAAC,GAEF;AACT;",
5
5
  "names": []
6
6
  }
@@ -27,7 +27,9 @@ function Redirect(param) {
27
27
  } catch (error) {
28
28
  console.error(error);
29
29
  }
30
- }), null;
30
+ }, [
31
+ href
32
+ ]), null;
31
33
  }
32
34
  // Annotate the CommonJS export names for ESM import in node:
33
35
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/link/Users/n8/one/packages/one/src/link/Redirect.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;mBAA0B,qBAE1B,wBAA+B;AAGxB,SAASA,SAAS,OAAkC;MAAlC,EAAEC,KAAI,IAAN,OACjBC,aAASC,wBAAAA;AACfC,mDAAe,WAAA;AACb,QAAI;AACFF,aAAOG,QAAQJ,IAAAA;IACjB,SAASK,OAAO;AACdC,cAAQD,MAAMA,KAAAA;IAChB;EACF,CAAA,GACO;AACT;",
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;mBAA0B,qBAE1B,wBAA+B;AAIxB,SAASA,SAAS,OAAkC;MAAlC,EAAEC,KAAI,IAAN,OACjBC,aAASC,wBAAAA;AAEfC,mDAAe,WAAA;AACb,QAAI;AACFF,aAAOG,QAAQJ,IAAAA;IACjB,SAASK,OAAO;AACdC,cAAQD,MAAMA,KAAAA;IAChB;EACF,GAAG;IAACL;GAAK,GAEF;AACT;",
5
5
  "names": ["Redirect", "href", "router", "useRouter", "useFocusEffect", "replace", "error", "console"]
6
6
  }
@@ -1,9 +1,7 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all) __defProp(target, name, {
9
7
  get: all[name],
@@ -17,36 +15,19 @@ var __export = (target, all) => {
17
15
  });
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
32
21
  var useFocusEffect_exports = {};
33
22
  __export(useFocusEffect_exports, {
34
23
  useFocusEffect: () => useFocusEffect
35
24
  });
36
25
  module.exports = __toCommonJS(useFocusEffect_exports);
37
- var React = __toESM(require("react"), 1),
26
+ var import_react = require("react"),
38
27
  import_useLoadedNavigation = require("./link/useLoadedNavigation.cjs");
39
- function useFocusEffect(effect, do_not_pass_a_second_prop) {
28
+ function useFocusEffect(effect, args) {
40
29
  const navigation = (0, import_useLoadedNavigation.useOptionalNavigation)();
41
- do_not_pass_a_second_prop !== void 0 && console.error(`You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
42
-
43
- useFocusEffect(
44
- React.useCallback(() => {
45
- // Your code here
46
- }, [depA, depB])
47
- );
48
-
49
- See usage guide: https://reactnavigation.org/docs/use-focus-effect`), React.useEffect(() => {
30
+ (0, import_react.useEffect)(() => {
50
31
  if (!navigation) return;
51
32
  let isFocused = !1,
52
33
  cleanup;
@@ -76,13 +57,13 @@ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message +=
76
57
  };
77
58
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
78
59
  const unsubscribeFocus = navigation.addListener("focus", () => {
79
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
60
+ isFocused || (cleanup?.(), cleanup = callback(), isFocused = !0);
80
61
  }),
81
62
  unsubscribeBlur = navigation.addListener("blur", () => {
82
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
63
+ cleanup?.(), cleanup = void 0, isFocused = !1;
83
64
  });
84
65
  return () => {
85
- cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
66
+ cleanup?.(), unsubscribeFocus(), unsubscribeBlur();
86
67
  };
87
- }, [effect, navigation]);
68
+ }, [navigation, ...args]);
88
69
  }
@@ -1,8 +1,7 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
7
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -12,31 +11,16 @@ var __export = (target, all) => {
12
11
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
12
  return to;
14
13
  };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
15
  var useFocusEffect_exports = {};
24
16
  __export(useFocusEffect_exports, {
25
17
  useFocusEffect: () => useFocusEffect
26
18
  });
27
19
  module.exports = __toCommonJS(useFocusEffect_exports);
28
- var React = __toESM(require("react"), 1), import_useLoadedNavigation = require("./link/useLoadedNavigation");
29
- function useFocusEffect(effect, do_not_pass_a_second_prop) {
20
+ var import_react = require("react"), import_useLoadedNavigation = require("./link/useLoadedNavigation");
21
+ function useFocusEffect(effect, args) {
30
22
  const navigation = (0, import_useLoadedNavigation.useOptionalNavigation)();
31
- do_not_pass_a_second_prop !== void 0 && console.error(`You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
32
-
33
- useFocusEffect(
34
- React.useCallback(() => {
35
- // Your code here
36
- }, [depA, depB])
37
- );
38
-
39
- See usage guide: https://reactnavigation.org/docs/use-focus-effect`), React.useEffect(() => {
23
+ (0, import_react.useEffect)(() => {
40
24
  if (!navigation)
41
25
  return;
42
26
  let isFocused = !1, cleanup;
@@ -67,13 +51,13 @@ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message +=
67
51
  };
68
52
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
69
53
  const unsubscribeFocus = navigation.addListener("focus", () => {
70
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
54
+ isFocused || (cleanup?.(), cleanup = callback(), isFocused = !0);
71
55
  }), unsubscribeBlur = navigation.addListener("blur", () => {
72
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
56
+ cleanup?.(), cleanup = void 0, isFocused = !1;
73
57
  });
74
58
  return () => {
75
- cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
59
+ cleanup?.(), unsubscribeFocus(), unsubscribeBlur();
76
60
  };
77
- }, [effect, navigation]);
61
+ }, [navigation, ...args]);
78
62
  }
79
63
  //# sourceMappingURL=useFocusEffect.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useFocusEffect.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB,8BAEvB,6BAAsC;AAW/B,SAAS,eAAe,QAAwB,2BAAmC;AACxF,QAAM,iBAAa,kDAAsB;AAEzC,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,WAAW,MAAM;AACrB,YAAM,UAAU,OAAO;AAEvB,UAAI,YAAY,UAAa,OAAO,WAAY;AAC9C,eAAO;AAGT,UAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,YAAI,UACF;AAEF,QAAI,YAAY,OACd,WACE,qGACO,OAAQ,QAAgB,QAAS,aAC1C,WACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sEAeF,WAAW,kBAAkB,KAAK,UAAU,OAAO,CAAC,MAGtD,QAAQ,MAAM,OAAO;AAAA,MACvB;AAAA,IACF;AAGA,IAAI,WAAW,UAAU,MACvB,UAAU,SAAS,GACnB,YAAY;AAGd,UAAM,mBAAmB,WAAW,YAAY,SAAS,MAAM;AAG7D,MAAI,cACJ,UAAU,GACV,UAAU,SAAS,GACnB,YAAY;AAAA,IACd,CAAC,GAEK,kBAAkB,WAAW,YAAY,QAAQ,MAAM;AAC3D,gBAAU,GACV,UAAU,QACV,YAAY;AAAA,IACd,CAAC;AAED,WAAO,MAAM;AACX,gBAAU,GACV,iBAAiB,GACjB,gBAAgB;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC;AAC1B;",
5
5
  "names": []
6
6
  }
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
- 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, __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -13,43 +12,24 @@ var __export = (target, all) => {
13
12
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
13
  return to;
15
14
  };
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);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
16
  var useFocusEffect_exports = {};
25
17
  __export(useFocusEffect_exports, {
26
18
  useFocusEffect: () => useFocusEffect
27
19
  });
28
20
  module.exports = __toCommonJS(useFocusEffect_exports);
29
- var React = __toESM(require("react"), 1), import_useLoadedNavigation = require("./link/useLoadedNavigation");
30
- function useFocusEffect(effect, do_not_pass_a_second_prop) {
21
+ var import_react = require("react"), import_useLoadedNavigation = require("./link/useLoadedNavigation");
22
+ function useFocusEffect(effect, args) {
31
23
  var navigation = (0, import_useLoadedNavigation.useOptionalNavigation)();
32
- if (do_not_pass_a_second_prop !== void 0) {
33
- var message = `You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
34
-
35
- useFocusEffect(
36
- React.useCallback(() => {
37
- // Your code here
38
- }, [depA, depB])
39
- );
40
-
41
- See usage guide: https://reactnavigation.org/docs/use-focus-effect`;
42
- console.error(message);
43
- }
44
- React.useEffect(function() {
24
+ (0, import_react.useEffect)(function() {
45
25
  if (navigation) {
46
26
  var isFocused = !1, cleanup, callback = function() {
47
27
  var destroy = effect();
48
28
  if (destroy === void 0 || typeof destroy == "function")
49
29
  return destroy;
50
30
  if (process.env.NODE_ENV !== "production") {
51
- var message2 = "An effect function must not return anything besides a function, which is used for clean-up.";
52
- destroy === null ? message2 += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message2 += `
31
+ var message = "An effect function must not return anything besides a function, which is used for clean-up.";
32
+ destroy === null ? message += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message += `
53
33
 
54
34
  It looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. Instead, write the async function inside your effect and call it immediately:
55
35
 
@@ -65,22 +45,22 @@ useFocusEffect(
65
45
  }, [someId])
66
46
  );
67
47
 
68
- See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message2 += ` You returned '${JSON.stringify(destroy)}'.`, console.error(message2);
48
+ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message += ` You returned '${JSON.stringify(destroy)}'.`, console.error(message);
69
49
  }
70
50
  };
71
51
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
72
52
  var unsubscribeFocus = navigation.addListener("focus", function() {
73
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
53
+ isFocused || (cleanup == null || cleanup(), cleanup = callback(), isFocused = !0);
74
54
  }), unsubscribeBlur = navigation.addListener("blur", function() {
75
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
55
+ cleanup == null || cleanup(), cleanup = void 0, isFocused = !1;
76
56
  });
77
57
  return function() {
78
- cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
58
+ cleanup == null || cleanup(), unsubscribeFocus(), unsubscribeBlur();
79
59
  };
80
60
  }
81
61
  }, [
82
- effect,
83
- navigation
62
+ navigation,
63
+ ...args
84
64
  ]);
85
65
  }
86
66
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/one/packages/one/src/useFocusEffect.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAEA,YAAuB,8BAEvB,6BAAsC;AAW/B,SAASA,eAAeC,QAAwBC,2BAAiC;AACtF,MAAMC,iBAAaC,kDAAAA;AAEnB,MAAIF,8BAA8BG,QAAW;AAC3C,QAAMC,UACJ;;;;;;;;;AASFC,YAAQC,MAAMF,OAAAA;EAChB;AAEAG,QAAMC,UAAU,WAAA;AACd,QAAKP,YAIL;UAAIQ,YAAY,IACZC,SAEEC,WAAW,WAAA;AACf,YAAMC,UAAUb,OAAAA;AAEhB,YAAIa,YAAYT,UAAa,OAAOS,WAAY;AAC9C,iBAAOA;AAGT,YAAIC,QAAQC,IAAIC,aAAa,cAAc;AACzC,cAAIX,WACF;AAEF,UAAIQ,YAAY,OACdR,YACE,qGACO,OAAQQ,QAAgBI,QAAS,aAC1CZ,YACE;;;;;;;;;;;;;;;;sEAeFA,YAAW,kBAAkBa,KAAKC,UAAUN,OAAAA,CAAAA,MAG9CP,QAAQC,MAAMF,QAAAA;QAChB;MACF;AAGA,MAAIH,WAAWQ,UAAS,MACtBC,UAAUC,SAAAA,GACVF,YAAY;AAGd,UAAMU,mBAAmBlB,WAAWmB,YAAY,SAAS,WAAA;AAGvD,QAAIX,cAIAC,YAAYP,UACdO,QAAAA,GAGFA,UAAUC,SAAAA,GACVF,YAAY;MACd,CAAA,GAEMY,kBAAkBpB,WAAWmB,YAAY,QAAQ,WAAA;AACrD,QAAIV,YAAYP,UACdO,QAAAA,GAGFA,UAAUP,QACVM,YAAY;MACd,CAAA;AAEA,aAAO,WAAA;AACL,QAAIC,YAAYP,UACdO,QAAAA,GAGFS,iBAAAA,GACAE,gBAAAA;MACF;;EACF,GAAG;IAACtB;IAAQE;GAAW;AACzB;",
5
- "names": ["useFocusEffect", "effect", "do_not_pass_a_second_prop", "navigation", "useOptionalNavigation", "undefined", "message", "console", "error", "React", "useEffect", "isFocused", "cleanup", "callback", "destroy", "process", "env", "NODE_ENV", "then", "JSON", "stringify", "unsubscribeFocus", "addListener", "unsubscribeBlur"]
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;AAGA,mBAA0B,kBAC1B,6BAAsC;AAU/B,SAASA,eAAeC,QAAwBC,MAAW;AAChE,MAAMC,iBAAaC,kDAAAA;AAEnBC,8BAAU,WAAA;AACR,QAAKF,YAIL;UAAIG,YAAY,IACZC,SAEEC,WAAW,WAAA;AACf,YAAMC,UAAUR,OAAAA;AAEhB,YAAIQ,YAAYC,UAAa,OAAOD,WAAY;AAC9C,iBAAOA;AAGT,YAAIE,QAAQC,IAAIC,aAAa,cAAc;AACzC,cAAIC,UACF;AAEF,UAAIL,YAAY,OACdK,WACE,qGACO,OAAQL,QAAgBM,QAAS,aAC1CD,WACE;;;;;;;;;;;;;;;;sEAeFA,WAAW,kBAAkBE,KAAKC,UAAUR,OAAAA,CAAAA,MAG9CS,QAAQC,MAAML,OAAAA;QAChB;MACF;AAGA,MAAIX,WAAWG,UAAS,MACtBC,UAAUC,SAAAA,GACVF,YAAY;AAGd,UAAMc,mBAAmBjB,WAAWkB,YAAY,SAAS,WAAA;AAGvD,QAAIf,cACJC,WAAAA,QAAAA,QAAAA,GACAA,UAAUC,SAAAA,GACVF,YAAY;MACd,CAAA,GAEMgB,kBAAkBnB,WAAWkB,YAAY,QAAQ,WAAA;AACrDd,mBAAAA,QAAAA,QAAAA,GACAA,UAAUG,QACVJ,YAAY;MACd,CAAA;AAEA,aAAO,WAAA;AACLC,mBAAAA,QAAAA,QAAAA,GACAa,iBAAAA,GACAE,gBAAAA;MACF;;EACF,GAAG;IAACnB;OAAeD;GAAK;AAC1B;",
5
+ "names": ["useFocusEffect", "effect", "args", "navigation", "useOptionalNavigation", "useEffect", "isFocused", "cleanup", "callback", "destroy", "undefined", "process", "env", "NODE_ENV", "message", "then", "JSON", "stringify", "console", "error", "unsubscribeFocus", "addListener", "unsubscribeBlur"]
6
6
  }
@@ -8,7 +8,7 @@ function Redirect({ href }) {
8
8
  } catch (error) {
9
9
  console.error(error);
10
10
  }
11
- }), null;
11
+ }, [href]), null;
12
12
  }
13
13
  export {
14
14
  Redirect
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/link/Redirect.tsx"],
4
- "mappings": "AAAA,SAAS,iBAAiB;AAE1B,SAAS,sBAAsB;AAGxB,SAAS,SAAS,EAAE,KAAK,GAA6B;AAC3D,QAAM,SAAS,UAAU;AACzB,wBAAe,MAAM;AACnB,QAAI;AACF,aAAO,QAAQ,IAAI;AAAA,IACrB,SAAS,OAAO;AACd,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF,CAAC,GACM;AACT;",
4
+ "mappings": "AAAA,SAAS,iBAAiB;AAE1B,SAAS,sBAAsB;AAIxB,SAAS,SAAS,EAAE,KAAK,GAA6B;AAC3D,QAAM,SAAS,UAAU;AAEzB,wBAAe,MAAM;AACnB,QAAI;AACF,aAAO,QAAQ,IAAI;AAAA,IACrB,SAAS,OAAO;AACd,cAAQ,MAAM,KAAK;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,IAAI,CAAC,GAEF;AACT;",
5
5
  "names": []
6
6
  }
@@ -10,7 +10,7 @@ function Redirect({
10
10
  } catch (error) {
11
11
  console.error(error);
12
12
  }
13
- }), null;
13
+ }, [href]), null;
14
14
  }
15
15
  export { Redirect };
16
16
  //# sourceMappingURL=Redirect.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useRouter","useFocusEffect","Redirect","href","router","replace","error","console"],"sources":["../../../src/link/Redirect.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAE1B,SAASC,cAAA,QAAsB;AAGxB,SAASC,SAAS;EAAEC;AAAK,GAA6B;EAC3D,MAAMC,MAAA,GAASJ,SAAA,CAAU;EACzB,OAAAC,cAAA,CAAe,MAAM;IACnB,IAAI;MACFG,MAAA,CAAOC,OAAA,CAAQF,IAAI;IACrB,SAASG,KAAA,EAAO;MACdC,OAAA,CAAQD,KAAA,CAAMA,KAAK;IACrB;EACF,CAAC,GACM;AACT","ignoreList":[]}
1
+ {"version":3,"names":["useRouter","useFocusEffect","Redirect","href","router","replace","error","console"],"sources":["../../../src/link/Redirect.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAE1B,SAASC,cAAA,QAAsB;AAIxB,SAASC,SAAS;EAAEC;AAAK,GAA6B;EAC3D,MAAMC,MAAA,GAASJ,SAAA,CAAU;EAEzB,OAAAC,cAAA,CAAe,MAAM;IACnB,IAAI;MACFG,MAAA,CAAOC,OAAA,CAAQF,IAAI;IACrB,SAASG,KAAA,EAAO;MACdC,OAAA,CAAQD,KAAA,CAAMA,KAAK;IACrB;EACF,GAAG,CAACH,IAAI,CAAC,GAEF;AACT","ignoreList":[]}
@@ -11,7 +11,7 @@ function Redirect(param) {
11
11
  } catch (error) {
12
12
  console.error(error);
13
13
  }
14
- }), null;
14
+ }, [href]), null;
15
15
  }
16
16
  export { Redirect };
17
17
  //# sourceMappingURL=Redirect.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useRouter","useFocusEffect","Redirect","param","href","router","replace","error","console"],"sources":["../../../src/link/Redirect.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAE1B,SAASC,cAAA,QAAsB;AAGxB,SAASC,SAASC,KAAE,EAAK;EAC9B;MAAMC;IAAA,IAASD,KAAA;IAAAE,MAAU,GAAAL,SAAA;EACzB,OAAAC,cAAA,CAAe,YAAM;IACnB,IAAI;MACFI,MAAA,CAAOC,OAAA,CAAQF,IAAI;IACrB,SAASG,KAAA,EAAO;MACdC,OAAA,CAAQD,KAAA,CAAMA,KAAK;IACrB;EACF,CAAC,GACM;AACT","ignoreList":[]}
1
+ {"version":3,"names":["useRouter","useFocusEffect","Redirect","param","href","router","replace","error","console"],"sources":["../../../src/link/Redirect.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAE1B,SAASC,cAAA,QAAsB;AAIxB,SAASC,SAASC,KAAE,EAAK;EAC9B;MAAMC;IAAA,IAASD,KAAA;IAAAE,MAAU,GAAAL,SAAA;EAEzB,OAAAC,cAAA,CAAe,YAAM;IACnB,IAAI;MACFI,MAAA,CAAOC,OAAA,CAAQF,IAAI;IACrB,SAASG,KAAA,EAAO;MACdC,OAAA,CAAQD,KAAA,CAAMA,KAAK;IACrB;EACF,GAAG,CAGLH,IAAA,C","ignoreList":[]}
@@ -1,16 +1,8 @@
1
- import * as React from "react";
1
+ import { useEffect } from "react";
2
2
  import { useOptionalNavigation } from "./link/useLoadedNavigation";
3
- function useFocusEffect(effect, do_not_pass_a_second_prop) {
3
+ function useFocusEffect(effect, args) {
4
4
  const navigation = useOptionalNavigation();
5
- do_not_pass_a_second_prop !== void 0 && console.error(`You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
6
-
7
- useFocusEffect(
8
- React.useCallback(() => {
9
- // Your code here
10
- }, [depA, depB])
11
- );
12
-
13
- See usage guide: https://reactnavigation.org/docs/use-focus-effect`), React.useEffect(() => {
5
+ useEffect(() => {
14
6
  if (!navigation)
15
7
  return;
16
8
  let isFocused = !1, cleanup;
@@ -41,14 +33,14 @@ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message +=
41
33
  };
42
34
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
43
35
  const unsubscribeFocus = navigation.addListener("focus", () => {
44
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
36
+ isFocused || (cleanup?.(), cleanup = callback(), isFocused = !0);
45
37
  }), unsubscribeBlur = navigation.addListener("blur", () => {
46
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
38
+ cleanup?.(), cleanup = void 0, isFocused = !1;
47
39
  });
48
40
  return () => {
49
- cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
41
+ cleanup?.(), unsubscribeFocus(), unsubscribeBlur();
50
42
  };
51
- }, [effect, navigation]);
43
+ }, [navigation, ...args]);
52
44
  }
53
45
  export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A,SAAS,iBAAiB;AAC1B,SAAS,6BAA6B;AAU/B,SAAS,eAAe,QAAwB,MAAa;AAClE,QAAM,aAAa,sBAAsB;AAEzC,YAAU,MAAM;AACd,QAAI,CAAC;AACH;AAGF,QAAI,YAAY,IACZ;AAEJ,UAAM,WAAW,MAAM;AACrB,YAAM,UAAU,OAAO;AAEvB,UAAI,YAAY,UAAa,OAAO,WAAY;AAC9C,eAAO;AAGT,UAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,YAAI,UACF;AAEF,QAAI,YAAY,OACd,WACE,qGACO,OAAQ,QAAgB,QAAS,aAC1C,WACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sEAeF,WAAW,kBAAkB,KAAK,UAAU,OAAO,CAAC,MAGtD,QAAQ,MAAM,OAAO;AAAA,MACvB;AAAA,IACF;AAGA,IAAI,WAAW,UAAU,MACvB,UAAU,SAAS,GACnB,YAAY;AAGd,UAAM,mBAAmB,WAAW,YAAY,SAAS,MAAM;AAG7D,MAAI,cACJ,UAAU,GACV,UAAU,SAAS,GACnB,YAAY;AAAA,IACd,CAAC,GAEK,kBAAkB,WAAW,YAAY,QAAQ,MAAM;AAC3D,gBAAU,GACV,UAAU,QACV,YAAY;AAAA,IACd,CAAC;AAED,WAAO,MAAM;AACX,gBAAU,GACV,iBAAiB,GACjB,gBAAgB;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC;AAC1B;",
5
5
  "names": []
6
6
  }
@@ -1,16 +1,8 @@
1
- import * as React from "react";
1
+ import { useEffect } from "react";
2
2
  import { useOptionalNavigation } from "./link/useLoadedNavigation.mjs";
3
- function useFocusEffect(effect, do_not_pass_a_second_prop) {
3
+ function useFocusEffect(effect, args) {
4
4
  const navigation = useOptionalNavigation();
5
- do_not_pass_a_second_prop !== void 0 && console.error(`You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
6
-
7
- useFocusEffect(
8
- React.useCallback(() => {
9
- // Your code here
10
- }, [depA, depB])
11
- );
12
-
13
- See usage guide: https://reactnavigation.org/docs/use-focus-effect`), React.useEffect(() => {
5
+ useEffect(() => {
14
6
  if (!navigation) return;
15
7
  let isFocused = !1,
16
8
  cleanup;
@@ -40,15 +32,15 @@ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message +=
40
32
  };
41
33
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
42
34
  const unsubscribeFocus = navigation.addListener("focus", () => {
43
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
35
+ isFocused || (cleanup?.(), cleanup = callback(), isFocused = !0);
44
36
  }),
45
37
  unsubscribeBlur = navigation.addListener("blur", () => {
46
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
38
+ cleanup?.(), cleanup = void 0, isFocused = !1;
47
39
  });
48
40
  return () => {
49
- cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
41
+ cleanup?.(), unsubscribeFocus(), unsubscribeBlur();
50
42
  };
51
- }, [effect, navigation]);
43
+ }, [navigation, ...args]);
52
44
  }
53
45
  export { useFocusEffect };
54
46
  //# sourceMappingURL=useFocusEffect.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useOptionalNavigation","useFocusEffect","effect","do_not_pass_a_second_prop","navigation","console","error","useEffect","isFocused","cleanup","callback","destroy","process","env","NODE_ENV","message","then","JSON","stringify","unsubscribeFocus","addListener","unsubscribeBlur"],"sources":["../../src/useFocusEffect.ts"],"sourcesContent":[null],"mappings":"AAEA,YAAYA,KAAA,MAAW;AAEvB,SAASC,qBAAA,QAA6B;AAW/B,SAASC,eAAeC,MAAA,EAAwBC,yBAAA,EAAmC;EACxF,MAAMC,UAAA,GAAaJ,qBAAA,CAAsB;EAErCG,yBAAA,KAA8B,UAWhCE,OAAA,CAAQC,KAAA,CATN;AAAA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,CAACnB,MAAA,EAAQE,UAAU,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useOptionalNavigation","useFocusEffect","effect","args","navigation","isFocused","cleanup","callback","destroy","process","env","NODE_ENV","message","then","JSON","stringify","console","error","unsubscribeFocus","addListener","unsubscribeBlur"],"sources":["../../src/useFocusEffect.ts"],"sourcesContent":[null],"mappings":"AAGA,SAASA,SAAA,QAAiB;AAC1B,SAASC,qBAAA,QAA6B;AAU/B,SAASC,eAAeC,MAAA,EAAwBC,IAAA,EAAa;EAClE,MAAMC,UAAA,GAAaJ,qBAAA,CAAsB;EAEzCD,SAAA,CAAU,MAAM;IACd,IAAI,CAACK,UAAA,EACH;IAGF,IAAIC,SAAA,GAAY;MACZC,OAAA;IAEJ,MAAMC,QAAA,GAAWA,CAAA,KAAM;MACrB,MAAMC,OAAA,GAAUN,MAAA,CAAO;MAEvB,IAAIM,OAAA,KAAY,UAAa,OAAOA,OAAA,IAAY,YAC9C,OAAOA,OAAA;MAGT,IAAIC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,cAAc;QACzC,IAAIC,OAAA,GACF;QAEEJ,OAAA,KAAY,OACdI,OAAA,IACE,qGACO,OAAQJ,OAAA,CAAgBK,IAAA,IAAS,aAC1CD,OAAA,IACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sEAeFA,OAAA,IAAW,kBAAkBE,IAAA,CAAKC,SAAA,CAAUP,OAAO,CAAC,MAGtDQ,OAAA,CAAQC,KAAA,CAAML,OAAO;MACvB;IACF;IAGIR,UAAA,CAAWC,SAAA,CAAU,MACvBC,OAAA,GAAUC,QAAA,CAAS,GACnBF,SAAA,GAAY;IAGd,MAAMa,gBAAA,GAAmBd,UAAA,CAAWe,WAAA,CAAY,SAAS,MAAM;QAGzDd,SAAA,KACJC,OAAA,GAAU,GACVA,OAAA,GAAUC,QAAA,CAAS,GACnBF,SAAA,GAAY;MACd,CAAC;MAEKe,eAAA,GAAkBhB,UAAA,CAAWe,WAAA,CAAY,QAAQ,MAAM;QAC3Db,OAAA,GAAU,GACVA,OAAA,GAAU,QACVD,SAAA,GAAY;MACd,CAAC;IAED,OAAO,MAAM;MACXC,OAAA,GAAU,GACVY,gBAAA,CAAiB,GACjBE,eAAA,CAAgB;IAClB;EACF,GAAG,CAAChB,UAAA,EAAY,GAAGD,IAAI,CAAC;AAC1B","ignoreList":[]}
@@ -1,20 +1,8 @@
1
- import * as React from "react";
1
+ import { useEffect } from "react";
2
2
  import { useOptionalNavigation } from "./link/useLoadedNavigation.native.js";
3
- function useFocusEffect(effect, do_not_pass_a_second_prop) {
3
+ function useFocusEffect(effect, args) {
4
4
  var navigation = useOptionalNavigation();
5
- if (do_not_pass_a_second_prop !== void 0) {
6
- var message = `You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
7
-
8
- useFocusEffect(
9
- React.useCallback(() => {
10
- // Your code here
11
- }, [depA, depB])
12
- );
13
-
14
- See usage guide: https://reactnavigation.org/docs/use-focus-effect`;
15
- console.error(message);
16
- }
17
- React.useEffect(function () {
5
+ useEffect(function () {
18
6
  if (navigation) {
19
7
  var isFocused = !1,
20
8
  cleanup,
@@ -22,8 +10,8 @@ See usage guide: https://reactnavigation.org/docs/use-focus-effect`;
22
10
  var destroy = effect();
23
11
  if (destroy === void 0 || typeof destroy == "function") return destroy;
24
12
  if (process.env.NODE_ENV !== "production") {
25
- var message2 = "An effect function must not return anything besides a function, which is used for clean-up.";
26
- destroy === null ? message2 += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message2 += `
13
+ var message = "An effect function must not return anything besides a function, which is used for clean-up.";
14
+ destroy === null ? message += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message += `
27
15
 
28
16
  It looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. Instead, write the async function inside your effect and call it immediately:
29
17
 
@@ -39,21 +27,21 @@ useFocusEffect(
39
27
  }, [someId])
40
28
  );
41
29
 
42
- See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message2 += ` You returned '${JSON.stringify(destroy)}'.`, console.error(message2);
30
+ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message += ` You returned '${JSON.stringify(destroy)}'.`, console.error(message);
43
31
  }
44
32
  };
45
33
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
46
34
  var unsubscribeFocus = navigation.addListener("focus", function () {
47
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
35
+ isFocused || (cleanup?.(), cleanup = callback(), isFocused = !0);
48
36
  }),
49
37
  unsubscribeBlur = navigation.addListener("blur", function () {
50
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
38
+ cleanup?.(), cleanup = void 0, isFocused = !1;
51
39
  });
52
40
  return function () {
53
- cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
41
+ cleanup?.(), unsubscribeFocus(), unsubscribeBlur();
54
42
  };
55
43
  }
56
- }, [effect, navigation]);
44
+ }, [navigation, ...args]);
57
45
  }
58
46
  export { useFocusEffect };
59
47
  //# sourceMappingURL=useFocusEffect.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useOptionalNavigation","useFocusEffect","effect","do_not_pass_a_second_prop","navigation","message","console","error","useEffect","isFocused","cleanup","callback","destroy","process","env","NODE_ENV","message2","then","JSON","stringify","unsubscribeFocus","addListener","unsubscribeBlur"],"sources":["../../src/useFocusEffect.ts"],"sourcesContent":[null],"mappings":"AAEA,YAAYA,KAAA,MAAW;AAEvB,SAASC,qBAAA,QAA6B;AAW/B,SAASC,eAAeC,MAAA,EAAwBC,yBAAA,EAAmC;EACxF,IAAAC,UAAM,GAAAJ,qBAAa;EAEf,IAAAG,yBAAA,KAA8B,MAWhC;IATE,IAAAE,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaF,mEAAK;IACHC,OAAA,CAAAC,KAAA,CAAAF,OAAA;EAGF;EAGAN,KAAA,CAAAS,SAAM,aAAiB;IACrB,IAAAJ,UAAM;MAEN,IAAIK,SAAA,GAAY;QAAAC,OAAa;QAAAC,QAAO,YAAAA,CAAA,EAAY;UAC9C,IAAAC,OAAO,GAAAV,MAAA;UAGT,IAAIU,OAAQ,KAAI,iBAAaA,OAAA,IAAc,YACzC,OAAIA,OACF;UAEE,IAAAC,OAAA,CAAYC,GAAA,CAAAC,QACd,iBACE;YAGA,IAAAC,QAAA;YAAAJ,OAAA,YAAAI,QAAA,gHAAAJ,OAAA,CAAAK,IAAA,iBAAAD,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBiB;AACvB,mEACF,GAAAA,QAAA,sBAAAE,IAAA,CAAAC,SAAA,CAAAP,OAAA,OAAAN,OAAA,CAAAC,KAAA,CAAAS,QAAA;UAGI;QAKJ;MAGMZ,UAAA,CAAAK,SAIA,OAAYC,OAAA,GACdC,QAAQ,EAGV,EAAAF,SAAU;MAEX,IAEKW,gBAAkB,GAAAhB,UAAW,CAAAiB,WAAY,QAAQ,cAAM;UACvDZ,SAAA,KAAYC,OACd,UAGF,KAAAA,OAAU,IAAAA,OACV,GAAAC,QAAY,IAAAF,SAAA;QACb;QAAAa,eAAA,GAAAlB,UAAA,CAAAiB,WAAA;UAEDX,OAAO,KAAM,UAAAA,OAAA,IAAAA,OAAA,WAAAD,SAAA;QACP;MAMN;QACEC,OAAQ,UAAW,KAAAA,OAAA,IAAAU,gBAAA,IAAAE,eAAA;MACzB","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useOptionalNavigation","useFocusEffect","effect","args","navigation","isFocused","cleanup","callback","destroy","process","env","NODE_ENV","message","then","JSON","stringify","console","error","unsubscribeFocus","addListener","unsubscribeBlur"],"sources":["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
3
- "version": "1.1.454",
3
+ "version": "1.1.456",
4
4
  "license": "BSD-3-Clause",
5
5
  "sideEffects": [
6
6
  "setup.mjs",
@@ -94,15 +94,15 @@
94
94
  "@react-navigation/routers": "~7",
95
95
  "@swc/core": "^1.10.4",
96
96
  "@ungap/structured-clone": "^1.2.0",
97
- "@vxrn/compiler": "1.1.454",
98
- "@vxrn/resolve": "1.1.454",
99
- "@vxrn/tslib-lite": "1.1.454",
100
- "@vxrn/universal-color-scheme": "1.1.454",
101
- "@vxrn/use-isomorphic-layout-effect": "1.1.454",
97
+ "@vxrn/compiler": "1.1.456",
98
+ "@vxrn/resolve": "1.1.456",
99
+ "@vxrn/tslib-lite": "1.1.456",
100
+ "@vxrn/universal-color-scheme": "1.1.456",
101
+ "@vxrn/use-isomorphic-layout-effect": "1.1.456",
102
102
  "babel-dead-code-elimination": "^1.0.9",
103
103
  "citty": "^0.1.6",
104
104
  "core-js": "^3.38.1",
105
- "create-vxrn": "1.1.454",
105
+ "create-vxrn": "1.1.456",
106
106
  "escape-string-regexp": "^5.0.0",
107
107
  "expo-linking": "~6.3.1",
108
108
  "expo-modules-core": "2.1.2",
@@ -129,12 +129,12 @@
129
129
  "vite": "^6.1.0",
130
130
  "vite-plugin-barrel": "^0.4.1",
131
131
  "vite-tsconfig-paths": "^5.0.1",
132
- "vxrn": "1.1.454",
132
+ "vxrn": "1.1.456",
133
133
  "ws": "^8.18.0",
134
134
  "xxhashjs": "^0.2.2"
135
135
  },
136
136
  "devDependencies": {
137
- "@tamagui/build": "^1.125.8",
137
+ "@tamagui/build": "^1.125.18",
138
138
  "@types/node": "^22.1.0",
139
139
  "@types/react-dom": "^18.2.25",
140
140
  "@types/xxhashjs": "^0.2.4",
@@ -3,14 +3,17 @@ import type { OneRouter } from '../interfaces/router'
3
3
  import { useFocusEffect } from '../useFocusEffect'
4
4
 
5
5
  /** Redirects to the href as soon as the component is mounted. */
6
+
6
7
  export function Redirect({ href }: { href: OneRouter.Href }) {
7
8
  const router = useRouter()
9
+
8
10
  useFocusEffect(() => {
9
11
  try {
10
12
  router.replace(href)
11
13
  } catch (error) {
12
14
  console.error(error)
13
15
  }
14
- })
16
+ }, [href])
17
+
15
18
  return null
16
19
  }
@@ -1,7 +1,7 @@
1
1
  // A fork of `useFocusEffect` that waits for the navigation state to load before
2
2
  // running the effect. This is especially useful for native redirects.
3
- import * as React from 'react'
4
3
 
4
+ import { useEffect } from 'react'
5
5
  import { useOptionalNavigation } from './link/useLoadedNavigation'
6
6
 
7
7
  type EffectCallback = () => undefined | void | (() => void)
@@ -9,28 +9,13 @@ type EffectCallback = () => undefined | void | (() => void)
9
9
  /**
10
10
  * Hook to run an effect in a focused screen, similar to `React.useEffect`.
11
11
  * This can be used to perform side-effects such as fetching data or subscribing to events.
12
- * The passed callback should be wrapped in `React.useCallback` to avoid running the effect too often.
13
12
  *
14
13
  * @param callback Memoized callback containing the effect, should optionally return a cleanup function.
15
14
  */
16
- export function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop?: never) {
15
+ export function useFocusEffect(effect: EffectCallback, args: any[]) {
17
16
  const navigation = useOptionalNavigation()
18
17
 
19
- if (do_not_pass_a_second_prop !== undefined) {
20
- const message =
21
- "You passed a second argument to 'useFocusEffect', but it only accepts one argument. " +
22
- "If you want to pass a dependency array, you can use 'React.useCallback':\n\n" +
23
- 'useFocusEffect(\n' +
24
- ' React.useCallback(() => {\n' +
25
- ' // Your code here\n' +
26
- ' }, [depA, depB])\n' +
27
- ');\n\n' +
28
- 'See usage guide: https://reactnavigation.org/docs/use-focus-effect'
29
-
30
- console.error(message)
31
- }
32
-
33
- React.useEffect(() => {
18
+ useEffect(() => {
34
19
  if (!navigation) {
35
20
  return
36
21
  }
@@ -85,34 +70,22 @@ export function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop
85
70
  const unsubscribeFocus = navigation.addListener('focus', () => {
86
71
  // If callback was already called for focus, avoid calling it again
87
72
  // The focus event may also fire on intial render, so we guard against runing the effect twice
88
- if (isFocused) {
89
- return
90
- }
91
-
92
- if (cleanup !== undefined) {
93
- cleanup()
94
- }
95
-
73
+ if (isFocused) return
74
+ cleanup?.()
96
75
  cleanup = callback()
97
76
  isFocused = true
98
77
  })
99
78
 
100
79
  const unsubscribeBlur = navigation.addListener('blur', () => {
101
- if (cleanup !== undefined) {
102
- cleanup()
103
- }
104
-
80
+ cleanup?.()
105
81
  cleanup = undefined
106
82
  isFocused = false
107
83
  })
108
84
 
109
85
  return () => {
110
- if (cleanup !== undefined) {
111
- cleanup()
112
- }
113
-
86
+ cleanup?.()
114
87
  unsubscribeFocus()
115
88
  unsubscribeBlur()
116
89
  }
117
- }, [effect, navigation])
90
+ }, [navigation, ...args])
118
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Redirect.d.ts","sourceRoot":"","sources":["../../src/link/Redirect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAGrD,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAA;CAAE,QAU1D"}
1
+ {"version":3,"file":"Redirect.d.ts","sourceRoot":"","sources":["../../src/link/Redirect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAGrD,iEAAiE;AAEjE,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAA;CAAE,QAY1D"}
@@ -2,10 +2,9 @@ type EffectCallback = () => undefined | void | (() => void);
2
2
  /**
3
3
  * Hook to run an effect in a focused screen, similar to `React.useEffect`.
4
4
  * This can be used to perform side-effects such as fetching data or subscribing to events.
5
- * The passed callback should be wrapped in `React.useCallback` to avoid running the effect too often.
6
5
  *
7
6
  * @param callback Memoized callback containing the effect, should optionally return a cleanup function.
8
7
  */
9
- export declare function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop?: never): void;
8
+ export declare function useFocusEffect(effect: EffectCallback, args: any[]): void;
10
9
  export {};
11
10
  //# sourceMappingURL=useFocusEffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFocusEffect.d.ts","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"AAMA,KAAK,cAAc,GAAG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAA;AAE3D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,yBAAyB,CAAC,EAAE,KAAK,QAsGvF"}
1
+ {"version":3,"file":"useFocusEffect.d.ts","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"AAMA,KAAK,cAAc,GAAG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAA;AAE3D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,QA4EjE"}