Skip to content

Commit

Permalink
fix(useMediaQuery): strict isSupported check
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 6, 2022
1 parent 1fd3496 commit 5a64cb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/useMediaQuery/index.ts
Expand Up @@ -14,7 +14,7 @@ import { defaultWindow } from '../_configurable'
*/
export function useMediaQuery(query: string, options: ConfigurableWindow = {}) {
const { window = defaultWindow } = options
const isSupported = Boolean(window && 'matchMedia' in window)
const isSupported = Boolean(window && 'matchMedia' in window && typeof 'matchMedia' === 'function')

let mediaQuery: MediaQueryList | undefined
const matches = ref(false)
Expand Down

0 comments on commit 5a64cb5

Please sign in to comment.