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

Function onChange

packages/react/src/hooks/use-mobile.ts:10–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 React.useEffect(() => {
9 const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
10 const onChange = () => {
11 setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
12 };
13 mql.addEventListener("change", onChange);
14 setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
15 return () => mql.removeEventListener("change", onChange);

Callers 15

ObjectFieldsFunction · 0.50
JsonSchemaFieldFunction · 0.50
FieldControlFunction · 0.50
ConstFieldFunction · 0.50
NumberFieldFunction · 0.50
setItemFunction · 0.50
ArrayFieldFunction · 0.50
JsonFallbackFieldFunction · 0.50
FilterTabsFunction · 0.50
commitFunction · 0.50
TagInputFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected