UNPKG

@frontify/fondue

Version:
18 lines (17 loc) 533 B
import { useState as o, useEffect as s } from "react"; const d = () => { const [t, n] = o(!1); return s(() => { const e = () => { const i = window.matchMedia("only screen and (max-width: 640px)").matches; n(i); }; return e(), window.addEventListener("resize", e), window.addEventListener("load", e), () => { window.removeEventListener("resize", e), window.removeEventListener("load", e); }; }, []), t; }; export { d as useMobileDetection }; //# sourceMappingURL=useMobileDetection.es.js.map