Skip to content

useSupported

Category
Export Size
194 B
Last Changed
6 months ago

SSR compatibility isSupported

Usage

ts
import { useSupported } from '@vueuse/core'

const isSupported = useSupported(() => navigator && 'getBattery' in navigator)

if (isSupported.value) {
  // do something
  navigator.getBattery
}
import { useSupported } from '@vueuse/core'

const isSupported = useSupported(() => navigator && 'getBattery' in navigator)

if (isSupported.value) {
  // do something
  navigator.getBattery
}

Source

SourceDocs

Contributors

Fernando Fernández
Jelf

Changelog

v10.0.0-beta.2 on 3/28/2023
55a32 - feat: support tracking reactivity for the callback function (#2904)
v8.9.2 on 7/12/2022
81d92 - fix(all)!: isSupported becomes Ref instead of boolean for SSR compatibility (#1800)

Released under the MIT License.