@anoki/fse-ui
Version:
FSE UI components library
20 lines (19 loc) • 462 B
JavaScript
import { useState as t, useEffect as d } from "react";
function o() {
return typeof window < "u" ? window.innerWidth : null;
}
function r() {
const [n, i] = t(o());
return d(() => {
if (typeof window > "u")
return;
function e() {
i(window.innerWidth);
}
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
}, []), n;
}
export {
r as default
};
//# sourceMappingURL=index.es451.js.map