Custom hook that tracks the state of a media query using the Match Media API.
import { useMediaQuery } from "@tealess/hooks"; export default function Component() { const matches = useMediaQuery("(min-width: 768px)"); return <div>{`The view port is ${matches ? "at least" : "less than"} 768 pixels wide`}</div>; }