vite-plugin-vue-devtools
vite-plugin-vue-devtools copied to clipboard
perf(utils): useMediaQuery
There is a bug in the current codebase, isSupported
need to be called instead of directly used it:
Because isSupported
is not a reactive variable, so must re-check every time when running the update
function.
Please update, thanks!
There is a bug in the current codebase,
isSupported
need to be called instead of directly used it:Because `isSupported` is not a reactive variable, so must re-check every time when running the `update` function.
Please update, thanks!
I know it's a bug, I do it in outer const isSupported = (() => window && 'matchMedia' in window && typeof window.matchMedia === 'function')()
so if we use useMediaQuery multiple, we will never call isSupported
There is a bug in the current codebase,
isSupported
need to be called instead of directly used it:Because
isSupported
is not a reactive variable, so must re-check every time when running theupdate
function. Please update, thanks!I know it's a bug, I do it in outer
const isSupported = (() => window && 'matchMedia' in window && typeof window.matchMedia === 'function')()
so if we use useMediaQuery multiple, we will never call isSupported
Yeah, I mean Because isSupported is not a reactive variable, so must re-check every time when running the update function.