useMedia
useMedia
is an custom hook for utilizing media queries in your component
logic.
Import#
import { useMedia } from '@dwarvesf/react-hooks'
Usage#
Parameters#
The useDisclosure
hook accepts an list of following paramesters:
useMedia(queries, values, defaultValue)
Name | Type | Default | Description |
---|---|---|---|
queries | string[] | _ | The list of media queries. |
values | any[] | _ | The values relate to the list of media queries by array index. |
defaultValue | any | _ | The default value if none of the values matches the media queries. |