Evaluate a CSS media query via JavaScript.

Example

const isTablet = useMediaQuery("(max-width: 768px)");

return <div>{isTablet ? "is phone or tablet" : "is desktop"}</div>;