MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handler

Function handler

packages/react/src/hooks/use-is-dark.ts:16–16  ·  view source on GitHub ↗
(event: MediaQueryListEvent)

Source from the content-addressed store, hash-verified

14 if (typeof window === "undefined") return;
15 const mql = window.matchMedia("(prefers-color-scheme: dark)");
16 const handler = (event: MediaQueryListEvent) => setDark(event.matches);
17 mql.addEventListener("change", handler);
18 return () => mql.removeEventListener("change", handler);
19 }, []);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected