MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / useMediaQuery

Function useMediaQuery

apps/public/src/components/ui/slider.tsx:7–14  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

5import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip';
6
7function useMediaQuery(query: string) {
8 const [matches, setMatches] = React.useState(false);
9 React.useEffect(() => {
10 const media = window.matchMedia(query);
11 setMatches(media.matches);
12 }, [query]);
13 return matches;
14}
15
16const Slider = ({
17 ref,

Callers 2

SliderFunction · 0.85
useBreakpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected