@sikka/hawa 0.12.10-next → 0.12.12-next
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -13
- package/dist/index.mjs +11 -10
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6695,20 +6695,18 @@ var import_react34 = __toESM(require("react"));
|
|
|
6695
6695
|
// components/hooks/useBreakpoint.ts
|
|
6696
6696
|
var import_react33 = require("react");
|
|
6697
6697
|
var useBreakpoint = function() {
|
|
6698
|
-
var
|
|
6699
|
-
var _ref = _sliced_to_array((0, import_react33.useState)((_window = window) === null || _window === void 0 ? void 0 : _window.innerWidth), 2), breakpoint = _ref[0], setBreakpoint = _ref[1];
|
|
6700
|
-
var resize = function() {
|
|
6701
|
-
var _window;
|
|
6702
|
-
setBreakpoint((_window = window) === null || _window === void 0 ? void 0 : _window.innerWidth);
|
|
6703
|
-
};
|
|
6698
|
+
var _ref = _sliced_to_array((0, import_react33.useState)(null), 2), breakpoint = _ref[0], setBreakpoint = _ref[1];
|
|
6704
6699
|
(0, import_react33.useEffect)(function() {
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6700
|
+
if (typeof window !== "undefined") {
|
|
6701
|
+
var resize = function() {
|
|
6702
|
+
setBreakpoint(window.innerWidth);
|
|
6703
|
+
};
|
|
6704
|
+
resize();
|
|
6705
|
+
window.addEventListener("resize", resize);
|
|
6706
|
+
return function() {
|
|
6707
|
+
window.removeEventListener("resize", resize);
|
|
6708
|
+
};
|
|
6709
|
+
}
|
|
6712
6710
|
}, []);
|
|
6713
6711
|
return breakpoint;
|
|
6714
6712
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -6527,17 +6527,18 @@ import React59, { useEffect as useEffect15, useRef as useRef8, useState as useSt
|
|
|
6527
6527
|
// components/hooks/useBreakpoint.ts
|
|
6528
6528
|
import { useState as useState21, useEffect as useEffect14 } from "react";
|
|
6529
6529
|
var useBreakpoint = () => {
|
|
6530
|
-
const [breakpoint, setBreakpoint] = useState21(
|
|
6531
|
-
const resize = () => {
|
|
6532
|
-
setBreakpoint(window?.innerWidth);
|
|
6533
|
-
};
|
|
6530
|
+
const [breakpoint, setBreakpoint] = useState21(null);
|
|
6534
6531
|
useEffect14(() => {
|
|
6535
|
-
if (typeof window
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6532
|
+
if (typeof window !== "undefined") {
|
|
6533
|
+
const resize = () => {
|
|
6534
|
+
setBreakpoint(window.innerWidth);
|
|
6535
|
+
};
|
|
6536
|
+
resize();
|
|
6537
|
+
window.addEventListener("resize", resize);
|
|
6538
|
+
return () => {
|
|
6539
|
+
window.removeEventListener("resize", resize);
|
|
6540
|
+
};
|
|
6541
|
+
}
|
|
6541
6542
|
}, []);
|
|
6542
6543
|
return breakpoint;
|
|
6543
6544
|
};
|