UNPKG

welcome-ui

Version:

Customizable design system with react, typescript, tailwindcss and ariakit.

18 lines (17 loc) 518 B
"use client"; import { useEffect as n, useLayoutEffect as o, useState as d } from "react"; const r = typeof window > "u" ? n : o; function w() { const [t, e] = d({ height: void 0, width: void 0 }); return r(() => { e({ height: window.innerHeight, width: window.innerWidth }); function i() { e({ height: window.innerHeight, width: window.innerWidth }); } return window.addEventListener("resize", i), () => window.removeEventListener("resize", i); }, []), t; } export { r as a, w as u };