useMediaControls watch `target` that may not be a Ref
jcc1997 opened this issue · comments
cj97 commented
Describe the bug
target: MaybeRef<HTMLMediaElement | null | undefined>
maybe just an element. But not Ref.
so codes below watching target
causes warnings.
vueuse/packages/core/useMediaControls/index.ts
Lines 297 to 319 in 1558cd2
Reproduction
https://stackblitz.com/edit/vitejs-vite-liqyke?file=src%2FApp.vue
System Info
System:
OS: macOS 14.2.1
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 81.46 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: 4.0.2 - ~/.nvm/versions/node/v18.18.2/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
Browsers:
Chrome: 123.0.6312.107
Edge: 123.0.2420.81
Safari: 17.2.1
npmPackages:
@vueuse/components: ^10.7.2 => 10.7.2
@vueuse/core: ^10.9.0 => 10.9.0
@vueuse/router: ^10.7.2 => 10.7.2
vue: ^3.4.21 => 3.4.21
Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.