MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / handler

Function handler

src/hooks/useIsMobile.ts:12–12  ·  view source on GitHub ↗
(e: MediaQueryListEvent | MediaQueryList)

Source from the content-addressed store, hash-verified

10 useEffect(() => {
11 const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
12 const handler = (e: MediaQueryListEvent | MediaQueryList) => setIsMobile(e.matches);
13 handler(mql);
14 mql.addEventListener("change", handler);
15 return () => mql.removeEventListener("change", handler);

Callers 1

useIsMobileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected