useMediaQuery is a custom hook used to help detect whether a single media
query or multiple media queries individually match.
useMediaQuery hook returns an array of booleans, indicating whether the
given query matches or queries match.
Why an array?
useMediaQuery accepts both a string and an array of strings, but
will always return an array. This way, you can combine multiple media queries
which will be individually matched in a single call.
Keep in mind this API relies on the users browser support of
window.matchMediaand will always return
falseif it is not supported or does not exist (e.g. during serverside rendering).
smaller than 1280px
rendering on something else, e.g. PWA