Loading homepage
Subscribe to a browser media query with accurate snapshots, cleanup, and a server-rendering fallback.
Input: const wide = useMediaQuery("(min-width: 900px)"); Output: true while the viewport matches; updates when the match changes.
Input: const dark = useMediaQuery("(prefers-color-scheme: dark)", false); Output: Uses false for server rendering and the browser match after hydration.
Implement the exported React hook in index.js or index.ts. Tests provide fixtures for the required behavior.