Function useMediaQuery

  • Returns true if the window matches the media query, or false otherwise.

    Parameters

    • query: string

      The media query to match.

    • Optional initialValue: boolean

      If non-undefined then returned during SSR and the initial client render.

    Returns boolean