@trashpanda001/helpers
    Preparing search index...

    Function useMediaQuery

    • Monitor changes in media query state.

      Parameters

      • query: string

        media query

      Returns boolean

      true if media query matches, false otherwise

      Check if the screen is at a mobile breakpoint.

      import { useMediaQuery } from "@trashpanda001/helpers/react"

      function Component() {
      const isMobile = useMediaQuery("(max-width: 600px)")
      return <div>{isMobile ? "Mobile" : "Desktop"}</div>
      }