@uxf/core-react 13.0.3 → 14.1.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.
Files changed (61) hide show
  1. package/README.md +85 -56
  2. package/clickable/_use-simulated-button.js +9 -5
  3. package/clickable/use-button-props.js +108 -47
  4. package/global-context/index.test.js +23 -2
  5. package/hooks/use-body-scroll-lock.js +56 -27
  6. package/hooks/use-composed-refs.test.js +14 -2
  7. package/hooks/use-debounce.js +21 -6
  8. package/hooks/use-debounce.test.d.ts +1 -0
  9. package/hooks/use-debounce.test.js +75 -0
  10. package/hooks/use-focus-return.js +55 -23
  11. package/hooks/use-focus-trap.js +87 -53
  12. package/hooks/use-increment.js +47 -5
  13. package/hooks/use-input-focus.js +65 -19
  14. package/hooks/use-is-hydrated.d.ts +10 -0
  15. package/hooks/use-is-hydrated.js +24 -0
  16. package/hooks/use-is-hydrated.test.d.ts +1 -0
  17. package/hooks/use-is-hydrated.test.js +45 -0
  18. package/hooks/use-is-mounted.d.ts +5 -0
  19. package/hooks/use-is-mounted.js +20 -1
  20. package/hooks/use-isomorphic-layout-effect.d.ts +4 -0
  21. package/hooks/use-isomorphic-layout-effect.js +4 -0
  22. package/hooks/use-key.js +49 -18
  23. package/hooks/use-key.test.d.ts +1 -0
  24. package/hooks/use-key.test.js +145 -0
  25. package/hooks/use-latest.d.ts +5 -0
  26. package/hooks/use-latest.js +5 -0
  27. package/hooks/use-media-query.d.ts +10 -1
  28. package/hooks/use-media-query.js +77 -19
  29. package/hooks/use-media-query.test.d.ts +1 -0
  30. package/hooks/use-media-query.test.js +76 -0
  31. package/hooks/use-min-window-width.js +39 -18
  32. package/hooks/use-mouse-drag-to-scroll.js +116 -61
  33. package/hooks/use-mouse-drag-to-scroll.test.js +56 -10
  34. package/hooks/use-on-mount.js +20 -3
  35. package/hooks/use-on-unmount.d.ts +1 -0
  36. package/hooks/use-on-unmount.js +23 -7
  37. package/hooks/use-on-unmount.test.d.ts +1 -0
  38. package/hooks/use-on-unmount.test.js +16 -0
  39. package/hooks/use-on-update.d.ts +8 -0
  40. package/hooks/use-on-update.js +32 -8
  41. package/hooks/use-on-update.test.d.ts +1 -0
  42. package/hooks/use-on-update.test.js +90 -0
  43. package/hooks/use-pagination.js +30 -14
  44. package/hooks/use-previous.d.ts +5 -0
  45. package/hooks/use-previous.js +19 -3
  46. package/hooks/use-raf-state.js +35 -8
  47. package/hooks/use-toggle.js +42 -4
  48. package/hooks/use-window-scroll.d.ts +7 -2
  49. package/hooks/use-window-scroll.js +36 -15
  50. package/hooks/use-window-scroll.test.js +141 -39
  51. package/hooks/use-window-size.d.ts +7 -2
  52. package/hooks/use-window-size.js +34 -12
  53. package/hooks/use-window-size.test.js +147 -29
  54. package/package.json +10 -4
  55. package/swipeable/use-swipeable.test.js +31 -5
  56. package/translations/index.js +1 -1
  57. package/translations/replace-variables.js +4 -1
  58. package/translations/replace-variables.test.d.ts +1 -0
  59. package/translations/replace-variables.test.js +13 -0
  60. package/components/viewport-height-polyfill.d.ts +0 -2
  61. package/components/viewport-height-polyfill.js +0 -58
package/hooks/use-key.js CHANGED
@@ -1,27 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useKey = useKey;
4
+ const compiler_runtime_1 = require("react/compiler-runtime");
4
5
  const react_1 = require("react");
5
- const createKeyPredicate = (keyFilter) => typeof keyFilter === "function"
6
- ? keyFilter
7
- : typeof keyFilter === "string"
8
- ? (e) => e.key === keyFilter
9
- : () => false;
10
- function useKey(keyFilter, callback, { disabled, targetRef, type = "keydown" } = {}) {
11
- (0, react_1.useEffect)(() => {
12
- if (disabled) {
13
- return;
14
- }
15
- const thisNode = (targetRef ? targetRef.current : document);
16
- const predicate = createKeyPredicate(keyFilter);
17
- const handler = (e) => {
18
- if (predicate(e)) {
6
+ const createKeyPredicate = keyFilter => typeof keyFilter === "function" ? keyFilter : typeof keyFilter === "string" ? e => e.key === keyFilter : () => false;
7
+ function useKey(keyFilter, callback, t0) {
8
+ const $ = (0, compiler_runtime_1.c)(10);
9
+ let t1;
10
+ if ($[0] !== t0) {
11
+ t1 = t0 === undefined ? {} : t0;
12
+ $[0] = t0;
13
+ $[1] = t1;
14
+ }
15
+ else {
16
+ t1 = $[1];
17
+ }
18
+ const { disabled, targetRef, type: t2 } = t1;
19
+ const type = t2 === undefined ? "keydown" : t2;
20
+ let t3;
21
+ if ($[2] !== callback || $[3] !== keyFilter) {
22
+ t3 = e => {
23
+ if (createKeyPredicate(keyFilter)(e)) {
19
24
  callback(e);
20
25
  }
21
26
  };
22
- thisNode === null || thisNode === void 0 ? void 0 : thisNode.addEventListener(type, handler);
23
- return () => {
24
- thisNode === null || thisNode === void 0 ? void 0 : thisNode.removeEventListener(type, handler);
27
+ $[2] = callback;
28
+ $[3] = keyFilter;
29
+ $[4] = t3;
30
+ }
31
+ else {
32
+ t3 = $[4];
33
+ }
34
+ const onKey = (0, react_1.useEffectEvent)(t3);
35
+ let t4;
36
+ if ($[5] !== disabled || $[6] !== onKey || $[7] !== targetRef || $[8] !== type) {
37
+ t4 = () => {
38
+ if (disabled) {
39
+ return;
40
+ }
41
+ const thisNode = targetRef ? targetRef.current : document;
42
+ const controller = new AbortController();
43
+ thisNode === null || thisNode === void 0 ? void 0 : thisNode.addEventListener(type, e_0 => onKey(e_0), {
44
+ signal: controller.signal
45
+ });
46
+ return () => controller.abort();
25
47
  };
26
- }, [callback, disabled, keyFilter, targetRef, type]);
48
+ $[5] = disabled;
49
+ $[6] = onKey;
50
+ $[7] = targetRef;
51
+ $[8] = type;
52
+ $[9] = t4;
53
+ }
54
+ else {
55
+ t4 = $[9];
56
+ }
57
+ (0, react_1.useEffect)(t4);
27
58
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const compiler_runtime_1 = require("react/compiler-runtime");
37
+ const react_1 = require("@testing-library/react");
38
+ const react_2 = __importStar(require("react"));
39
+ const use_key_1 = require("./use-key");
40
+ function Probe(props) {
41
+ const $ = (0, compiler_runtime_1.c)(8);
42
+ const ref = (0, react_2.useRef)(null);
43
+ const [isOpen, setIsOpen] = (0, react_2.useState)(false);
44
+ let t0;
45
+ if ($[0] !== props) {
46
+ t0 = () => props.onKey();
47
+ $[0] = props;
48
+ $[1] = t0;
49
+ }
50
+ else {
51
+ t0 = $[1];
52
+ }
53
+ let t1;
54
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
55
+ t1 = {
56
+ targetRef: ref
57
+ };
58
+ $[2] = t1;
59
+ }
60
+ else {
61
+ t1 = $[2];
62
+ }
63
+ (0, use_key_1.useKey)("Escape", t0, t1);
64
+ let t2;
65
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
66
+ t2 = react_2.default.createElement("button", { onClick: () => setIsOpen(true) }, "open");
67
+ $[3] = t2;
68
+ }
69
+ else {
70
+ t2 = $[3];
71
+ }
72
+ let t3;
73
+ if ($[4] !== isOpen) {
74
+ t3 = isOpen && react_2.default.createElement("div", { "data-testid": "t", ref: ref, tabIndex: -1 });
75
+ $[4] = isOpen;
76
+ $[5] = t3;
77
+ }
78
+ else {
79
+ t3 = $[5];
80
+ }
81
+ let t4;
82
+ if ($[6] !== t3) {
83
+ t4 = react_2.default.createElement(react_2.default.Fragment, null,
84
+ t2,
85
+ t3);
86
+ $[6] = t3;
87
+ $[7] = t4;
88
+ }
89
+ else {
90
+ t4 = $[7];
91
+ }
92
+ return t4;
93
+ }
94
+ test("listens on a target that appears after mount", () => {
95
+ const onKey = jest.fn();
96
+ const { getByText, getByTestId } = (0, react_1.render)(react_2.default.createElement(Probe, { onKey: onKey }));
97
+ (0, react_1.act)(() => getByText("open").click());
98
+ react_1.fireEvent.keyDown(getByTestId("t"), {
99
+ key: "Escape"
100
+ });
101
+ expect(onKey).toHaveBeenCalledTimes(1);
102
+ });
103
+ function Toggle(props) {
104
+ const $ = (0, compiler_runtime_1.c)(5);
105
+ const ref = (0, react_2.useRef)(null);
106
+ let t0;
107
+ if ($[0] !== props) {
108
+ t0 = () => props.onKey();
109
+ $[0] = props;
110
+ $[1] = t0;
111
+ }
112
+ else {
113
+ t0 = $[1];
114
+ }
115
+ let t1;
116
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
117
+ t1 = {
118
+ targetRef: ref
119
+ };
120
+ $[2] = t1;
121
+ }
122
+ else {
123
+ t1 = $[2];
124
+ }
125
+ (0, use_key_1.useKey)("Escape", t0, t1);
126
+ let t2;
127
+ if ($[3] !== props.isA) {
128
+ t2 = props.isA ? react_2.default.createElement("div", { "data-testid": "a", ref: ref }) : react_2.default.createElement("span", { "data-testid": "b", ref: ref });
129
+ $[3] = props.isA;
130
+ $[4] = t2;
131
+ }
132
+ else {
133
+ t2 = $[4];
134
+ }
135
+ return t2;
136
+ }
137
+ test("follows the target when the element is replaced", () => {
138
+ const onKey = jest.fn();
139
+ const { rerender, getByTestId } = (0, react_1.render)(react_2.default.createElement(Toggle, { isA: true, onKey: onKey }));
140
+ rerender(react_2.default.createElement(Toggle, { isA: false, onKey: onKey }));
141
+ react_1.fireEvent.keyDown(getByTestId("b"), {
142
+ key: "Escape"
143
+ });
144
+ expect(onKey).toHaveBeenCalledTimes(1);
145
+ });
@@ -1 +1,6 @@
1
+ /**
2
+ * @deprecated Writes `ref.current` during render, which React 19 asks not to do: a render that never commits
3
+ * leaves its value behind. To read the latest props or state from an effect or a listener it registers, use
4
+ * `useEffectEvent`; for a value read during render, use the value itself.
5
+ */
1
6
  export declare function useLatest<T>(current: T): import("react").RefObject<T>;
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLatest = useLatest;
4
4
  const react_1 = require("react");
5
+ /**
6
+ * @deprecated Writes `ref.current` during render, which React 19 asks not to do: a render that never commits
7
+ * leaves its value behind. To read the latest props or state from an effect or a listener it registers, use
8
+ * `useEffectEvent`; for a value read during render, use the value itself.
9
+ */
5
10
  function useLatest(current) {
6
11
  const storedValue = (0, react_1.useRef)(current);
7
12
  storedValue.current = current;
@@ -1,2 +1,11 @@
1
1
  export type UseMediaQueryCallback = (isMatching: boolean, mediaQueryString: string) => void;
2
- export declare function useMediaQuery(mediaQueryString: string, callback?: UseMediaQueryCallback, isSSR?: boolean): boolean;
2
+ /**
3
+ * Whether `mediaQueryString` matches, read through `useSyncExternalStore`: false on the server and during hydration,
4
+ * the real value from the first render of a component mounted on the client, and updated on every change.
5
+ */
6
+ export declare function useMediaQuery(mediaQueryString: string, callback?: UseMediaQueryCallback): boolean;
7
+ /**
8
+ * @deprecated `isSSR` is ignored. It opted client-only components out of the hydration-safe `false`; the hook now
9
+ * reads the real value whenever it is not hydrating. Drop the argument.
10
+ */
11
+ export declare function useMediaQuery(mediaQueryString: string, callback: UseMediaQueryCallback | undefined, isSSR: boolean | undefined): boolean;
@@ -2,26 +2,84 @@
2
2
  "use client";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.useMediaQuery = useMediaQuery;
5
+ const compiler_runtime_1 = require("react/compiler-runtime");
5
6
  const react_1 = require("react");
6
- const use_latest_1 = require("@uxf/core-react/hooks/use-latest");
7
- function useMediaQuery(mediaQueryString, callback, isSSR = true) {
8
- const [isMatching, setIsMatching] = (0, react_1.useState)(isSSR ? false : window.matchMedia(mediaQueryString).matches);
9
- const latestCallback = (0, use_latest_1.useLatest)(callback);
10
- (0, react_1.useEffect)(() => {
11
- const controller = new AbortController();
12
- const mqList = window.matchMedia(mediaQueryString);
13
- function handler(matches, media) {
14
- var _a;
15
- setIsMatching(matches);
16
- (_a = latestCallback.current) === null || _a === void 0 ? void 0 : _a.call(latestCallback, matches, media);
17
- }
18
- handler(mqList.matches, mqList.media);
19
- mqList.addEventListener("change", (e) => handler(e.matches, e.media), {
20
- signal: controller.signal,
21
- });
22
- return () => {
23
- controller.abort();
7
+ /**
8
+ * Whether `mediaQueryString` matches, read through `useSyncExternalStore`: false on the server and during hydration,
9
+ * the real value from the first render of a component mounted on the client, and updated on every change.
10
+ */
11
+ /**
12
+ * @deprecated `isSSR` is ignored. It opted client-only components out of the hydration-safe `false`; the hook now
13
+ * reads the real value whenever it is not hydrating. Drop the argument.
14
+ */
15
+ function useMediaQuery(mediaQueryString, callback) {
16
+ const $ = (0, compiler_runtime_1.c)(11);
17
+ let t0;
18
+ if ($[0] !== mediaQueryString) {
19
+ t0 = onStoreChange => {
20
+ const controller = new AbortController();
21
+ window.matchMedia(mediaQueryString).addEventListener("change", onStoreChange, {
22
+ signal: controller.signal
23
+ });
24
+ return () => controller.abort();
24
25
  };
25
- }, [latestCallback, mediaQueryString]);
26
+ $[0] = mediaQueryString;
27
+ $[1] = t0;
28
+ }
29
+ else {
30
+ t0 = $[1];
31
+ }
32
+ const subscribe = t0;
33
+ let t1;
34
+ if ($[2] !== mediaQueryString) {
35
+ t1 = () => window.matchMedia(mediaQueryString).matches;
36
+ $[2] = mediaQueryString;
37
+ $[3] = t1;
38
+ }
39
+ else {
40
+ t1 = $[3];
41
+ }
42
+ const isMatching = (0, react_1.useSyncExternalStore)(subscribe, t1, _temp);
43
+ let t2;
44
+ if ($[4] !== callback) {
45
+ t2 = (matches, media) => callback === null || callback === void 0 ? void 0 : callback(matches, media);
46
+ $[4] = callback;
47
+ $[5] = t2;
48
+ }
49
+ else {
50
+ t2 = $[5];
51
+ }
52
+ const onChange = (0, react_1.useEffectEvent)(t2);
53
+ let t3;
54
+ if ($[6] !== mediaQueryString || $[7] !== onChange) {
55
+ t3 = () => {
56
+ const controller_0 = new AbortController();
57
+ const mqList = window.matchMedia(mediaQueryString);
58
+ onChange(mqList.matches, mqList.media);
59
+ mqList.addEventListener("change", e => onChange(e.matches, e.media), {
60
+ signal: controller_0.signal
61
+ });
62
+ return () => controller_0.abort();
63
+ };
64
+ $[6] = mediaQueryString;
65
+ $[7] = onChange;
66
+ $[8] = t3;
67
+ }
68
+ else {
69
+ t3 = $[8];
70
+ }
71
+ let t4;
72
+ if ($[9] !== mediaQueryString) {
73
+ t4 = [mediaQueryString];
74
+ $[9] = mediaQueryString;
75
+ $[10] = t4;
76
+ }
77
+ else {
78
+ t4 = $[10];
79
+ }
80
+ (0, react_1.useEffect)(t3, t4);
26
81
  return isMatching;
27
82
  }
83
+ function _temp() {
84
+ return false;
85
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const compiler_runtime_1 = require("react/compiler-runtime");
7
+ const react_1 = require("@testing-library/react");
8
+ const react_2 = __importDefault(require("react"));
9
+ const server_1 = require("react-dom/server");
10
+ const use_media_query_1 = require("./use-media-query");
11
+ const originalMatchMedia = window.matchMedia;
12
+ function mockMatchMedia(initiallyMatches) {
13
+ let matches = initiallyMatches;
14
+ const listeners = new Set();
15
+ window.matchMedia = query => ({
16
+ get matches() {
17
+ return matches;
18
+ },
19
+ media: query,
20
+ addEventListener: (_type, listener) => listeners.add(listener),
21
+ removeEventListener: (_type, listener) => listeners.delete(listener)
22
+ });
23
+ return {
24
+ change(next) {
25
+ matches = next;
26
+ listeners.forEach(listener => listener({
27
+ matches: next,
28
+ media: "(min-width: 640px)"
29
+ }));
30
+ }
31
+ };
32
+ }
33
+ afterEach(() => {
34
+ window.matchMedia = originalMatchMedia;
35
+ });
36
+ test("a component mounted on the client gets the real value in its first render", () => {
37
+ mockMatchMedia(true);
38
+ const values = [];
39
+ (0, react_1.renderHook)(() => values.push((0, use_media_query_1.useMediaQuery)("(min-width: 640px)")));
40
+ expect(values.at(0)).toBe(true);
41
+ });
42
+ test("renders false on the server", () => {
43
+ function Probe() {
44
+ const $ = (0, compiler_runtime_1.c)(2);
45
+ const t0 = String((0, use_media_query_1.useMediaQuery)("(min-width: 640px)"));
46
+ let t1;
47
+ if ($[0] !== t0) {
48
+ t1 = react_2.default.createElement("span", null, t0);
49
+ $[0] = t0;
50
+ $[1] = t1;
51
+ }
52
+ else {
53
+ t1 = $[1];
54
+ }
55
+ return t1;
56
+ }
57
+ expect((0, server_1.renderToString)(react_2.default.createElement(Probe, null))).toContain("false");
58
+ });
59
+ test("follows changes and reports them, and the initial value, to the latest callback", () => {
60
+ const media = mockMatchMedia(false);
61
+ const first = jest.fn();
62
+ const latest = jest.fn();
63
+ const { result, rerender } = (0, react_1.renderHook)(props => (0, use_media_query_1.useMediaQuery)("(min-width: 640px)", props.callback), {
64
+ initialProps: {
65
+ callback: first
66
+ }
67
+ });
68
+ rerender({
69
+ callback: latest
70
+ });
71
+ (0, react_1.act)(() => media.change(true));
72
+ expect(result.current).toBe(true);
73
+ expect(first).toHaveBeenCalledWith(false, "(min-width: 640px)");
74
+ expect(latest).toHaveBeenCalledWith(true, "(min-width: 640px)");
75
+ expect(first).toHaveBeenCalledTimes(1);
76
+ });
@@ -1,31 +1,52 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useMinWindowWidth = useMinWindowWidth;
4
+ const compiler_runtime_1 = require("react/compiler-runtime");
4
5
  const react_1 = require("react");
5
6
  const use_raf_state_1 = require("./use-raf-state");
6
7
  /**
7
8
  * @deprecated Use useMediaQuery instead
8
9
  */
9
- function useMinWindowWidth(minWidth, debounce = 0) {
10
+ function useMinWindowWidth(minWidth, t0) {
11
+ const $ = (0, compiler_runtime_1.c)(5);
12
+ const debounce = t0 === undefined ? 0 : t0;
10
13
  const [state, setState] = (0, use_raf_state_1.useRafState)();
11
- (0, react_1.useEffect)(() => {
12
- const stateHandler = () => setState(window.innerWidth >= minWidth);
13
- let timer;
14
- const handler = () => {
15
- if (debounce > 0) {
14
+ let t1;
15
+ let t2;
16
+ if ($[0] !== debounce || $[1] !== minWidth || $[2] !== setState) {
17
+ t1 = () => {
18
+ const stateHandler = () => setState(window.innerWidth >= minWidth);
19
+ let timer;
20
+ const handler = () => {
21
+ if (debounce > 0) {
22
+ window.clearTimeout(timer);
23
+ timer = window.setTimeout(stateHandler, debounce);
24
+ }
25
+ else {
26
+ stateHandler();
27
+ }
28
+ };
29
+ stateHandler();
30
+ const controller = new AbortController();
31
+ window.addEventListener("resize", handler, {
32
+ signal: controller.signal
33
+ });
34
+ return () => {
35
+ controller.abort();
16
36
  window.clearTimeout(timer);
17
- timer = window.setTimeout(stateHandler, debounce);
18
- }
19
- else {
20
- stateHandler();
21
- }
37
+ };
22
38
  };
23
- stateHandler();
24
- window.addEventListener("resize", handler);
25
- return () => {
26
- window.removeEventListener("resize", handler);
27
- window.clearTimeout(timer);
28
- };
29
- }, [debounce, minWidth, setState]);
39
+ t2 = [debounce, minWidth, setState];
40
+ $[0] = debounce;
41
+ $[1] = minWidth;
42
+ $[2] = setState;
43
+ $[3] = t1;
44
+ $[4] = t2;
45
+ }
46
+ else {
47
+ t1 = $[3];
48
+ t2 = $[4];
49
+ }
50
+ (0, react_1.useEffect)(t1, t2);
30
51
  return state;
31
52
  }